css-selectors

How to mouse hover multiple elements using Selenium and extract the texts through Python

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-19 17:56:34
问题 I am currently trying to scrape a dynamic website which uses javascript to provide information after hovering over images. I am trying to obtain the data inside of the text containers brought up by hovering over these images, but am having difficulty doing so because when I define all of the elements, then attempt to create a loop which hovers over all of them, I only receive the text data from the first element I defined, over and over as many elements as there are (10 on this page.) Here is

How to mouse hover multiple elements using Selenium and extract the texts through Python

被刻印的时光 ゝ 提交于 2021-02-19 17:47:41
问题 I am currently trying to scrape a dynamic website which uses javascript to provide information after hovering over images. I am trying to obtain the data inside of the text containers brought up by hovering over these images, but am having difficulty doing so because when I define all of the elements, then attempt to create a loop which hovers over all of them, I only receive the text data from the first element I defined, over and over as many elements as there are (10 on this page.) Here is

Why does google-chrome-devtools identifies less number of elements through XPath then number of elements identified through CssSelector

◇◆丶佛笑我妖孽 提交于 2021-02-19 08:27:37
问题 I am trying to identify the elements containing the reviews on this webpage using google-chrome-devtools. Using the following xpath: //div[@class='text show-more__control'] The number of elements identified are: 15 Snapshot: Using the following css-selectors: div.text.show-more__control The number of elements identified are: 25 Snapshot: So, why does google-chrome-devtools identifies less number of elements through XPath then number of elements identified through CssSelector 回答1: The XPath is

How to print the text using a locator from the span in selenium webdriver python?

别等时光非礼了梦想. 提交于 2021-02-19 04:59:33
问题 I am using the selenium for UI testing. I have below inspect element of chrome browser. <div tabindex="-1" unselectable="on" role="gridcell" comp-id="2815" col-id="StartBaseMV" class="ag-cell ag-cell-not-inline-editing ag-cell-with-height cell-number ag-cell-value" style="width: 120px; left: 2020px; text-align: right; "> <span> <span class="ag-value-change-delta"></span> <span class="ag-value-change-value">($5,281,158)</span> </span> </div> What I tried for writing xpath. //div[@col-id=

What exactly does this CSS selector with a comma match?

╄→гoц情女王★ 提交于 2021-02-17 05:06:58
问题 I have a question about CSS selectors. In my CSS file I have the following code: .table_legenda th, td { text-align: left; vertical-align: top; font-weight: bold; color: #76818a; border-bottom: 1px solid #76818a; border-left: 1px solid #76818a; white-space: nowrap; overflow: hidden; } Exactly what elements does that select? I thought that it should select all the th and td elements inside a table having the class table_legenda . However, when I test it, the style also gets applied to td

What exactly does this CSS selector with a comma match?

放肆的年华 提交于 2021-02-17 05:05:48
问题 I have a question about CSS selectors. In my CSS file I have the following code: .table_legenda th, td { text-align: left; vertical-align: top; font-weight: bold; color: #76818a; border-bottom: 1px solid #76818a; border-left: 1px solid #76818a; white-space: nowrap; overflow: hidden; } Exactly what elements does that select? I thought that it should select all the th and td elements inside a table having the class table_legenda . However, when I test it, the style also gets applied to td

Message: element not interactable on accessing a tag python

六眼飞鱼酱① 提交于 2021-02-17 04:57:34
问题 I am trying to access the sign in button on the url as shown in the code below. I have verified the content of the url as well as the href. They are both consistent with what appears using inspect element dev tool. But on clicking the extracted element I get the error: Message: element not interactable I have no idea why is this occurring. Kindly help me solve this issue from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import

Message: element not interactable on accessing a tag python

女生的网名这么多〃 提交于 2021-02-17 04:57:29
问题 I am trying to access the sign in button on the url as shown in the code below. I have verified the content of the url as well as the href. They are both consistent with what appears using inspect element dev tool. But on clicking the extracted element I get the error: Message: element not interactable I have no idea why is this occurring. Kindly help me solve this issue from selenium import webdriver from selenium.webdriver.common.keys import Keys from selenium.webdriver.support.ui import

How to avoid StaleElementReferenceException error in python selenium

≡放荡痞女 提交于 2021-02-17 02:52:10
问题 There are tons of questions about this error however none of them could be able to help my case. First i get the main url's ids that i need url = 'http://www.mosquedirectory.co.uk/browse/uk/england/london' browser = webdriver.Chrome() browser.get(url) listing = browser.find_elements_by_id('directory_listingBrowse') and I append them in to list to avoid from the error but it is not even worked hold = [] for i in listing: hold.append(i) and from these hold list I loop in for loop and this is

Can selenium recognize aria-uuid as an ID for object recognition?

时光毁灭记忆、已成空白 提交于 2021-02-16 20:20:43
问题 I recently recommended to my devs to add IDs to each element on the project I'm working to make automation more robust, they added in aria-uuid to each element. I cannot get anything to recognize these IDs! I'm wondering if it is even possible? I'm using python/selenium. I've tried identifying elements by ID, I've done CSS selectors and xpaths but they have had a history of breaking between new builds. Relevant html: input class="short ng-valid ng-not-empty ng-valid-min ng-valid-required"