Skip to content

Tag: xpath

Selenium – How to find an element by part of the placeholder value?

Is there any way to find an element by a part of the placeholder value? And ideally, case insensitive. <input id=”id-9″ placeholder=”some TEXT”> Search by the following function doesn’t work browser.find_element(by=By.XPATH, value=”//input[@placeholder=’some te’]”) Answer You can always use contains instead of equals, as following: To make it case-insensitive you can use translate function, as following: Case-insensitive contains Xpath is taken

Scraping data through changing Xpaths

I can’t figure out how to scrape data, I am trying to scrape the product name, price and other information from the website, the product names are easy to access as they have similar xpath with only one tag that changes but for the prices the there are multiple changes to the tags.Is there an alternative to how I can

Performing web scraping using selenium on I am getting just one scraped review even though it was in loop and the xpath was correct

OUTPUT IS JUST ONE NAME AND NOT ALL I need to scrape all the reviews from Even I am running a loop I am getting only one username. Please help me out Answer You getting only 1 review because XPath locator you are using //*[@id=”app-base”]/div[1]/div[4]/div[1]/div[1]/div[3] returns only 1 element, so your for loop is performed only once. You can