Skip to content
Advertisement

Tag: selenium

Reddit isn’t scraping the top comments (python/selenium)

Put the entire code into a question, thank you to all that have replied but this issue is super annoying either way help is appreciated! Context: This code is meant to go onto the top reddit post of the day/week, then screenshot it and once that’s done it goes to the comments and screenshots the top comments of said post,

Finding specifig value in class – Selenium (Python)

I’m trying to scrap a website using selenium. I tried using XPATH, but the problem is that the rows on the website change over time… How can I scrap the website, so that it gives me the output ‘21,73’ ? Answer You can just use querySelector that accepts CSS selectors. I personally like them way more than XPath: If that

Following links and crawling them

I was trying to make a crawler to follow links, with this code I was able to get the links but the part of entering the links and getting the information I need was not working, so a friend helped me to come up with this code It gets the json with the page items, but in loop number 230

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

No Output While Running Selenium in Headless Mode, Working in Non Headless

“Questions seeking debugging help (“Why isn’t this code working?”) must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself.” The desired behavior is to create an output file of scraped pages as per this working code (in non headless mode) and here’s the shortest code necessary to reproduce

Advertisement