Skip to content

Tag: css-selectors

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

Getting text from a object with Selenium

I’m trying to get the text inside of <pre> tag and I have tried with get_attribute(‘text’), get_attribute(‘value’), .text(), .value(), get_attribute(“innerHTML”) but I keep failing: Snapshot: This is the code that i’m using: And this is what it says when print: Answer To print the text within the <pre> tag you can use either of the following locator strategies: Using css_selector