How do I connect Selenium to localhost?

247 Views Asked by At

I have some .php files in my MAMP/htdocs folder. I want to perform some automated stuff (I'm pretty much just trying to practice/test scraping on source code I copied from live pages to my machine to avoid getting banned/throttled) in Python Selenium by starting MAMP Servers and running the commands:

driver = webdriver.Chrome()
driver.get("localhost/filename.php")

But I get the error: InvalidArgumentException. My selenium works fine with live webpages. Is there a special way I need to connect to a localhost that's different than pages over the Internet?

0

There are 0 best solutions below