New answers tagged


you can try to use xpathElement = (xpath of List elements)[index]. Example in your case : xpath=(//android.view.View)[11]


I have made it big progress but there is last minor problem left. "df.append(pd.read_html(driver.page_source)[0])" with the code above want to append all the tables in the pages but it append only the first page repetitively. df = pd.read_html(driver.page_source)[0] while True: next_page_btn = driver.find_elements_by_xpath('//*[@id=&...


This will help you //p[@class='customer-service']/text()[normalize-space()][1]


You must be getting the wrong input tag. You're locating the search box with //input[@id='search'], I guess what you need is //input[@id='search_submit'].


Your xpath would be //h2/text()[2]. See the test here. P.S. - I have no idea why you need that xpath (since you're not mentioning that in your question) but as a side note: you will not be able to use this xpath with Selenium since Selenium cannot wrap a text node into a WebElement If you need that for Selenium, use the following approach: ...


Changes in the webpages will cause this type of error. In order to solve that: Try to put it in front of the function that performs the extraction At the start of the for loop if you have one

Top 50 recent answers are included