Category : selenium-chromedriver

While using selenium for python to scrape bet365, I learned that I needed to use (successfully) undetected-chromedriver This code worked like a charm up until just a few days ago import undetected_chromedriver as uc driver = uc.Chrome() driver.get(‘https://bet365.com’) Now, however, when using this I get this in my browser and my page is never returned. ..

Read more

I downloaded selenium and chrome driver but when i run import time from selenium import webdriver driver = webdriver.Chrome(executable_path="/Users/NahuApple/webDriver") driver.get(‘http://www.google.com/’); time.sleep(5) search_box = driver.find_element_by_name(‘q’) search_box.send_keys(‘ChromeDriver’) search_box.submit() time.sleep(5) driver.quit() I get this error selenium.common.exceptions.WebDriverException: Message: ‘webDriver’ executable may have wrong permissions? how can I fix this? Thanks in advance for the help. Source: Python..

Read more

I have a problem, that https://bet365.com started to block Selenium bots. I’ve tried everything, now my code looks like: username = os.getenv("USERNAME") userProfile = "C:Users" + username + "AppDataLocalGoogleChromeUser DataDefault" opts = webdriver.ChromeOptions() opts.add_argument("user-data-dir={}".format(userProfile)) opts.add_argument(‘–profile-directory=Profile 2’) opts.add_argument("user-agent=’Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36’") opts.add_experimental_option(‘useAutomationExtension’, False) opts.add_experimental_option("excludeSwitches", ["enable-automation", "ignore-certificate-errors", "safebrowsing-disable-download-protection", "safebrowsing-disable-auto-update", ..

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 am using selenium and python to do a big project, I have to go to 320000 webpages one by one and scrape details from each one and then sleep for a second and move on. As follows: links = ["https://www.thissite.com/page=1","https://www.thissite.com/page=2","https://www.thissite.com/page=3"] for i in links: browser.get(i) scrapedinfo = browser.find_elements_by_xpath("*//div/productprice").text open("file.csv","w").write(scrapedinfo) time.sleep(1) The Greatest problem with ..

Read more

I have created a python code which consists of modules both of selenium and openpyxl, and the code works fine in my Laptop. Converted it into exe and setup files using pyinstaller and it also runs well,but when I transfer it into another computer running on windows 10 with no python installed,it shows Runtime error..Pls ..

Read more

I made a code from bs4 import BeautifulSoup from selenium import webdriver from urllib.request import urlopen from urllib.parse import quote_plus import time url1 = "https://www.instagram.com/explore/tags/" url2 = input("write a hashtag : ") url = url1 + quote_plus(url2) driver = webdriver.Chrome(‘executable_path=r"C:Chromechromedriver.exe"’) driver.get(url) And I got an error message Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/selenium/webdriver/common/service.py", line ..

Read more

I was working around a little automator in python for instagram and all works until the moment I need to click the like button. I try everything but nothing happens: self.driver.find_element_by_class_name("v1Nh3").click() #until this all works, after this not self.driver.find_elements_by_class_name("_8-yf5").click() #error self.driver.execute_script("arguments[0].click();", self.driver.find_elements_by_class_name("_8-yf5")) #error ActionChains(self.driver).move_to_element(likeButton).click() #error Anyone has an idea of how achieve this? Source: Python ..

Read more