Category : selenium

I have a button <button type="submit" class="btn btn-default waves-effect waves-light"><i class="fa fa-search" aria-hidden="true"></i></button> I have already tested all this but without success # browser.find_element_by_class_name(‘fa fa-search’).click() # browser.find_element_by_xpath(‘/html/body/div[1]/div[1]/div/div[4]/div/form/div/button’).click() # WebDriverWait(browser, 20).until(EC.element_to_be_clickable((By.XPATH, ‘//*[@id="RechAvFormRadio"]/div/button’))).click() Source: Python-3x..

Read more

I’m trying out this hybrid method of running async browsers: import asyncio import time from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.chrome.options import Options from concurrent.futures.thread import ThreadPoolExecutor executor = ThreadPoolExecutor(2) options = Options() options.headless = True def scrape(url, *, loop): loop.run_in_executor(executor, scraper, url) def scraper(url: str): driver = webdriver.Chrome(‘./chromedriver’, options=options) driver.get(url) print(driver.title) ..

Read more

My code aims to cycle through the dates on this reservation site and check each of the day and timeslot for an availability. Below is a simplified version of the part I am struggling with, which is that ‘allentry’ does not return all the dates that are selectable in the calendar. It seems to only ..

Read more

I’m trying to web scrape this page and I’m looking for a way to click the load more button using selenium python. I have tried with these codes driver.find_element(By.LINK_TEXT, "Load more").click() driver.find_element_by_xpath(‘//*[@id="root"]/div/div[1]/div[1]/main/div[2]/div[1]/div/button/span’).click() driver.find_element_by_xpath(‘//*[@id="root"]/div/div[1]/div[1]/main/div[2]/div[1]/div/button’).click() but none of the above have worked the main code,My alternative solution was using the scroll like this… def infinite(driver): scroll_pause_time = ..

Read more

Not sure what I am missing here. Trying experiments with ActionChains and can’t get my mouse to move. Any thoughts? from selenium import webdriver from selenium.webdriver.common.action_chains import ActionChains from selenium.webdriver.common.by import By from selenium.webdriver.support import expected_conditions as EC from selenium.webdriver.support.ui import WebDriverWait driver = webdriver.Chrome() driver.get("https://www.google.com/") ship2usa(driver) time.sleep(2) button = driver.find_element_by_xpath("//input[@class=’gNO89b’]") action = webdriver.ActionChains(driver) action.move_to_element(button).click().perform() ..

Read more

I am trying the code from the following URL and it seems to be working for Opera- Drive Opera with selenium python import time from selenium import webdriver from selenium.webdriver.chrome import service webdriver_service = service.Service(‘D:Driveroperadriver_win64operadriver.exe’) webdriver_service.start() driver = webdriver.Remote(webdriver_service.service_url, webdriver.DesiredCapabilities.OPERA) driver.get(‘https://www.google.com/’) input_txt = driver.find_element_by_name(‘q’) input_txt.send_keys(‘operadrivern’) time.sleep(5) #see the result driver.quit() But I get error when ..

Read more

I’m writing a bot for TikTok with Python’s Selenium. When the bot enters the login data in https://www.tiktok.com/login/phone-or-email/email , I get a message that I should continue in the app. But when I log in manually, I don’t get this message. Say Tiktok recognizes and blocks Selenium. Does anyone know a way to work around ..

Read more