selenium

StaleElementReferenceException even after adding the wait while collecting the data from the wikipedia using web-scraping

时间秒杀一切 提交于 2021-02-02 10:02:32
问题 I am a newbie to the web-scraping. Pardon my silly mistakes if there are any. I have been working on a project in which I need a list of movies as my data. I am trying to collect the data from the wikipedia using web-scraping. Following is my code for the same: def MoviesList(years, driver): for year in years: driver.implicitly_wait(150) year.click() table = driver.find_element_by_xpath('/html/body/div[3]/div[3]/div[5]/div[1]/table[2]/tbody') movies = table.find_elements_by_xpath('tr/td[1]/i

StaleElementReferenceException even after adding the wait while collecting the data from the wikipedia using web-scraping

心已入冬 提交于 2021-02-02 09:56:26
问题 I am a newbie to the web-scraping. Pardon my silly mistakes if there are any. I have been working on a project in which I need a list of movies as my data. I am trying to collect the data from the wikipedia using web-scraping. Following is my code for the same: def MoviesList(years, driver): for year in years: driver.implicitly_wait(150) year.click() table = driver.find_element_by_xpath('/html/body/div[3]/div[3]/div[5]/div[1]/table[2]/tbody') movies = table.find_elements_by_xpath('tr/td[1]/i

Python Selenium cant find the Add photo and video button element on Facebook

拈花ヽ惹草 提交于 2021-02-02 09:55:13
问题 Im trying to upload an image to facebook and im unable to click on the Add photo and video button. When im looking at the html this is the element im trying to click: <input aria-label="Add Photo or Video" accept="video/*, video/x-m4v, video/webm, video/x-ms-wmv, video/x-msvideo, video/3gpp, video/flv, video/x-flv, video/mp4, video/quicktime, video/mpeg, video/ogv, .ts, .mkv, image/*, image/heic, image/heif" containerclassname="_5g_r" multiple="" name="composer_photo[]" display="inline" role=

CSS selector for reCaptcha checkbok using Selenium and vba excel

随声附和 提交于 2021-02-02 09:54:44
问题 In the website I am trying to fill some fields, there is a checkbok that I need to click to add the check mark in it <div class="rc-anchor-content"><div class="rc-inline-block"><div class="rc-anchor-center-container"><div class="rc-anchor-center-item rc-anchor-checkbox-holder"><span class="recaptcha-checkbox goog-inline-block recaptcha-checkbox-unchecked rc-anchor-checkbox recaptcha-checkbox-expired" role="checkbox" aria-checked="false" id="recaptcha-anchor" dir="ltr" aria-labelledby=

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

不羁岁月 提交于 2021-02-02 09:53:48
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

倾然丶 夕夏残阳落幕 提交于 2021-02-02 09:53:45
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

selenium.common.exceptions.NoSuchWindowException: Message: no such window error clicking an element within an iframe using Selenium and Python

倖福魔咒の 提交于 2021-02-02 09:53:24
问题 I'm starting with Selenium and have a question, basically I don't understand why when I switch to an iframe and select one of the elements I constantly get: selenium.common.exceptions.NoSuchWindowException: Message: no such window (Session info: chrome=84.0.4147.89) This is the relevan code, firstly I click on some element of the DOM containing the iframe that actually updates the iframe content and then select the iframe, switch to it and then select the element I want inside the HTML

How to read text that is under #shadow-root (user-agent)

牧云@^-^@ 提交于 2021-02-02 09:53:08
问题 I am using Selenium (Python) for automating a web page. I am trying to get text from an input field that is under #shadow-root (user-agent). Xpath I used: driver.find_element_by_xpath("**//*/p-calendar/span/input**").text is not returning anything. Attached the screenshot of my DOM element. Requirement: To get text from the shadow root : 01:01 回答1: As per @hayatoito 's (creator of Shadow DOM) comment: The original motivation of introducing a closed shadow tree is "Never allow an access to a

How to read text that is under #shadow-root (user-agent)

早过忘川 提交于 2021-02-02 09:52:26
问题 I am using Selenium (Python) for automating a web page. I am trying to get text from an input field that is under #shadow-root (user-agent). Xpath I used: driver.find_element_by_xpath("**//*/p-calendar/span/input**").text is not returning anything. Attached the screenshot of my DOM element. Requirement: To get text from the shadow root : 01:01 回答1: As per @hayatoito 's (creator of Shadow DOM) comment: The original motivation of introducing a closed shadow tree is "Never allow an access to a

Unable to send text to Email field on Microsoft login page using Selenium

我与影子孤独终老i 提交于 2021-02-02 09:45:09
问题 I'm trying to figure out a way to automatically log in / enter text into a given text field on a particular web page. I've already don't this before, but this particular page isn't responding to anything I've thrown at it yet. The default page load already has the auto-focus on the necessary text box. I'm currently using Python to write the Selenium code. My current script includes prior processes that lead to the page in question, where my current problem lies. Additionally, I've been