Home > Enterprise >  Starting selenium program in a manually opened browser
Starting selenium program in a manually opened browser

Time:10-21

I am using selenium and python in order to scrape data on a website.
The problem is I need to manually log in because there is a CAPTCHA after the login.
My question is the following : is there a way to start the program on a page that is already loaded ? (for example, here I would log to the website, solve the CAPTCHA manually, and then launch the program that would scrape the data)

Note: I have already been looking for an answer on SO but did not find it, might have missed it as it seems to be an obvious question.

CodePudding user response:

don't open in headless mode. open in head mode.

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

options = Options()
options.headless = False # Set false here
driver = webdriver.Chrome(options=options, executable_path=r'C:\path\to\chromedriver.exe')
driver.get("http://google.com/")
print ("Headless Chrome Initialized")
time.sleep(30) # wait 30 seconds, this should give enough time to manually do the capture
# do other code here
driver.quit()
  • Related