Python Forum
Really confused by Selenium Grid2, please help
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Really confused by Selenium Grid2, please help
#1
Hello,

I am trying to run a lot (10+) of headless Selenium instances all at once (in parallel). For example, I would like to visit a website and click on a button and then print the cookies from that website for every instance I open. Something like this:

    from selenium import webdriver
    from selenium.webdriver.chrome.options import Options

    options = Options()
    options.add_argument('--headless')
    options.add_argument("--start-maximized")
    driver = webdriver.Chrome(chrome_options=options, executable_path=".../chromedriver.exe")
    driver.get("https://www.google.co.uk/")
    driver.find_element_by_link_text("Privacy").click()

    cookies_list = driver.get_cookies()
    cookies_dict = {}
    for cookie in cookies_list:
        cookies_dict[cookie['name']] = cookie['value']

    print(cookies_dict)

    driver.quit()
I've spent about 4-5 hours trying to do this and nothing has worked. Every single tutorial I've visited is either useless, not Windows 10 or both. I've always hit an error along the way despite following their directions exactly, and the errors are often very odd (sorry for being vague).

Can anyone please explain to me how I can run a lot of these all at once using Selenium Grid2 or something else?

Thanks!
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Selenium: CRITICAL:root:Selenium module is not installed...Exiting program. AcszE 1 3,587 Nov-03-2017, 08:41 PM
Last Post: metulburr

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020