Relative Content

Tag Archive for pythonselenium-webdriverweb-scrapingselenium-chromedriver

Python selenium skips random amount of questions in a quiz

from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.service import Service from selenium.webdriver.support import expected_conditions as EC import time from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.chrome.options import Options service = Service(executable_path=”chromedriver.exe”) driver = webdriver.Chrome(service=service) chrome_options = Options() chrome_options.add_argument(‘–ignore-certificate-errors’) def launch_page(): driver.get(‘https://webpage.com’) […]

Selenium chrome-driver click problem in div element

try: button = WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, “//div[contains (@class, ‘hb-fzpaiS dEBb srjgzgk7zu4’)]”))) try: ActionChains(driver).move_to_element(button).click().perform() except Exception as e: print(f”Failed to click button using ActionChains for {link}: {e}”) try: driver.execute_script(“arguments[0].click();”, button) except Exception as e: print(f”Failed to click button using JavaScript for {link}: {e}”) try: button.click() except Exception as e: print(f”Failed to click button directly for {link}: {e}”) […]

How to save some data of website in a excel by using selenium and webdriver?

I am new to learning Python. A task has been assigned to me that I have to enter a website in the field of stock exchange and economy and save the data of some countries in an online excel sheet. I know I need to use the Selenium library and Webdriver to get started; But I don’t know what steps to take. Is there anyone who can guide me?
To begin, I am facing a problem. Despite installing webdriver, I get an error in VScode.