Category : selenium

So I’m trying to click a link if it contains this string somewhere in its html. Here is the HTML: <span class="_3A9bf_kZ6VBA2VBRND5gvf">r/smashbros</span> I’m trying to click the link if it contains the word "smash" somewhere in the element, how would I go about this? I know I can easily do driver.find_element_by_class_name("_3A9bf_kZ6VBA2VBRND5gvf").click() I’m trying to find ..

Read more

Okay so I was writing my first selenium code which is: browser.get(‘https://www.jetbrains.com/pycharm/’) browser.find_element_by_link_text(‘Download’) <selenium.webdriver.remote.webelement.WebElement (session="69f43bf4a5e98baf24ad3746dd01b514", element="0fa96685-d871-464f-aaaa-af02238a5f08")> I wanted to simply go to the pycharm website and click on downloads, which worked fine. But when I tried to store the previous function in a variable like so: elem = browser.find_element_by_link_text(‘Download’) I got all these errors: Traceback ..

Read more

I want to scrape news headlines from this link: https://www.newsnow.co.uk/h/Business+&+Finance?type=ln I want to expand news by clicking (using selenium) on the button ‘view more headlines’ to collect the max number of news headlines possible I created this code but failed to make the click to expand news : import time from selenium import webdriver u ..

Read more

I’m trying to scrape email addresses from a page and having some trouble getting the parent element that contains the email ‘@’ symbol. The emails are embedded within different element tags so I’m unable to just pick them out. There’s about 50,000 or so pages that I have to go through. url = ‘https://sec.report/Document/0001078782-20-000134/#f10k123119_ex10z22.htm’ Here ..

Read more

Still new(‘ish) to Selenium but I’ve scraped a number of pages and I’m super confused as to why I can’t get this to work without timing out because it cant find the element. I’m trying to just pull and save a large amount of Reddit source pages from Web.Archive.org to run separate script on later. ..

Read more

I got the next url related to an online store https://www.tiendasjumbo.co/buscar?q=mani and I cant extract the product label an another fields: from selenium import webdriver import time from random import randint driver = webdriver.Firefox(executable_path= "C:Program Files (x86)geckodriver.exe") driver.implicitly_wait(10) time.sleep(4) url = "https://www.tiendasjumbo.co/buscar?q=mani" driver.maximize_window() driver.get(url) driver.find_element_by_xpath(‘//h1[@class="impulse-title"]’) What am I doing wrong, I also tried to switch ..

Read more