Невозможно щелкнуть текст «Исследовать» на сайте Google Trends с помощью Selenium Python. ⇐ Python
Невозможно щелкнуть текст «Исследовать» на сайте Google Trends с помощью Selenium Python.
I need to get Google Trends data for past 30 days, past 12 months like that for the purpose of my current project. I'm able to get daily data using Google Trends API. The package has another API called InterestsOverTime but Google is blocking any kind of automation effort when I try to access Explore Page Using this API, web crawling or even Selenium.
So I decided to go to the main page and then click on the Explore page But I'm failing to do so using Selenium. I'm very new to Selenium so please help me out here
This is the code I'm using
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as ES chrome_options = Options() chrome_options.add_argument("--incognito") chrome_options.add_argument("--window-size=1920x1080") driver = webdriver.Chrome(options=chrome_options, keep_alive=True) url = "https://trends.google.com/trends/" driver.get(url) explore_button = WebDriverWait(driver,10).until( ES.visibility_of_element_located((By.XPATH,"//span[contains(text(),'Explore')]")) ) explore_button.click() I tried multiple ways to access including using wrapper APIS from Google Trends API and trying to access Explore Page using python web crawling and selenium but was not able to get it. Even trying to touch the text Explore using Selenium is not working
Источник: https://stackoverflow.com/questions/781 ... ium-python
I need to get Google Trends data for past 30 days, past 12 months like that for the purpose of my current project. I'm able to get daily data using Google Trends API. The package has another API called InterestsOverTime but Google is blocking any kind of automation effort when I try to access Explore Page Using this API, web crawling or even Selenium.
So I decided to go to the main page and then click on the Explore page But I'm failing to do so using Selenium. I'm very new to Selenium so please help me out here
This is the code I'm using
from selenium import webdriver from selenium.webdriver.chrome.options import Options from selenium.webdriver.common.by import By from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.support import expected_conditions as ES chrome_options = Options() chrome_options.add_argument("--incognito") chrome_options.add_argument("--window-size=1920x1080") driver = webdriver.Chrome(options=chrome_options, keep_alive=True) url = "https://trends.google.com/trends/" driver.get(url) explore_button = WebDriverWait(driver,10).until( ES.visibility_of_element_located((By.XPATH,"//span[contains(text(),'Explore')]")) ) explore_button.click() I tried multiple ways to access including using wrapper APIS from Google Trends API and trying to access Explore Page using python web crawling and selenium but was not able to get it. Even trying to touch the text Explore using Selenium is not working
Источник: https://stackoverflow.com/questions/781 ... ium-python
-
- Похожие темы
- Ответы
- Просмотры
- Последнее сообщение
-
-
Должен ли я продолжить с ML/Data Science или исследовать другие карьерные пути? [закрыто]
Anonymous » » в форуме Python - 0 Ответы
- 11 Просмотры
-
Последнее сообщение Anonymous
-