webdriver

Infinite scrolling of webpage using Selenium Python

Infinite scrolling of webpage using Selenium Python Question: I want to scroll till all the element is loaded. My code works well for starting till 7 8 pages using this code. driver.get(‘https://www.bigbasket.com/ps/?q=rice’) last_height = driver.execute_script("return document.body.scrollHeight") while True: # Scroll down to bottom driver.execute_script("window.scrollTo(0, document.body.scrollHeight);") # Wait to load page WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, ‘//div[@class="show-more"]/button’))) driver.find_element_by_xpath(‘//div[@class="show-more"]/button’).click() # …

Total answers: 2

(Python) Selenium doesn't get the link when i configure my profile

(Python) Selenium doesn't get the link when i configure my profile Question: this is my first question here. i searched a lot in the site to answers, but i don’t get it. Can anyone please help? i’m trying to open the chrome with my profile, and it opens correctly, but, the line driver.get("https://google.com") is not …

Total answers: 1

Python Selenium iframe get element

Python Selenium iframe get element Question: This should be easy but somehow I’ve wasted 3 weeks trying to do this. I just want to get the Bid and Ask price from this site to print. https://www.jmbullion.com/charts/silver-prices/ The whole reason I made this account was to learn how to do this, but I just don’t know …

Total answers: 2

Scraping YouTube – can't scrape views successfully with Selenium

Scraping YouTube – can't scrape views successfully with Selenium Question: I’m doing a scraping project for Uni and I’m having a real hard time with some YouTube features. The main one I’m having trouble with is the views. Inspecting the code on the actual page, I found: <span dir="auto" class="style-scope yt-formatted-string bold" style-target="bold">10,504 views</span> So …

Total answers: 1

Ensure browser is closed even if script is forced exited

Ensure browser is closed even if script is forced exited Question: I am trying to close browser even if the script is not exited normally. I have tried few methods which I found on internet but failed to do so. First was to use try/except and finally. I implemented it but if does not works …

Total answers: 2

Clicking the button with Selenium Python

Clicking the button with Selenium Python Question: I am trying to write python code that clicks the "accept the cookies" button, but it doesn’t work. I could not understand the problem. Can you help me? Here is my code: Note: I am using MS Visual code, and from selenium import webdriver from selenium.webdriver.common.by import By …

Total answers: 3

how to click on link text selenium python

how to click on link text selenium python Question: i tried to click on link text but no work. Unable to locate element: {"method":"link text","selector":"Bán chạy"} please help me. My code: driver.find_element_by_link_text(‘Bán chạy’).click() https://shopee.vn/search?keyword=iphone Asked By: Luận Đặng Văn || Source Answers: driver.find_elements_by_xpath("//*[contains(text(), ‘Bán chạy”)]").click() Answered By: msurwillo You can do it by below way …

Total answers: 3

How to modify selenium webdriver dns to custom one

How to modify selenium webdriver dns to custom one Question: so for some reason my webdriver session does not able to enter some website that on my normal browser I can, I receive DNS_PROBE_FINISHED_NXDOMAIN error. I tried manually change the DNS provider to CloudFlare (1.1.1.1) and then it worked, how can I make the webdriver …

Total answers: 1

AttrributeError in Selenium Python

AttrributeError in Selenium Python Question: I am trying to write an auth bot with selenium, but I got an error that dont let code to be completed! The error is "AttributeError: ‘str’ object has no attribute ‘start’", you can see the code and the error in terminal below. Code: ` class LoginBot(): def __init__(self): #Excel …

Total answers: 1