简体   繁体   中英

How to open a new webpage using selenium on python?

I have been trying to get selenium to open a new web page, but it never works!

Error:

File "C:\Users\m11ro\OneDrive\Documents\test\Python Auto Bumper\test.py", line 31, in <module> driver.get("ogusers.com/Thread-Can-anyone-give-me-a-job") File "C:\Users\m11ro\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 333, in get self.execute(Command.GET, {'url': url}) File "C:\Users\m11ro\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute self.error_handler.check_response(response) File "C:\Users\m11ro\AppData\Local\Programs\Python\Python36\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.InvalidArgumentException: Message: invalid argument (Session info: chrome=**.*.****.***)

change

driver.get("ogusers.com/Thread-Can-anyone-give-me-a-job")

to

driver.get("https://ogusers.com/Thread-Can-anyone-give-me-a-job")

always remember to make sure your url has a url scheme

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM