Python Forum
Invalid argument error thrown.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Invalid argument error thrown.
#4
Here is the code which opens the url and after loading the page, it will kill the driver. Again it will open another session for next link in the file and it will close the driver once loading is done

 
import selenium.webdriver

with open('dataFile.txt', 'r') as urlFile:
   
    for url in urlFile.readlines():
        print(url)
        driver = selenium.webdriver.Chrome(r"C:\Users\Malathi\Downloads\chromedriver_win32\chromedriver.exe")
        driver.get(url, )
        link = driver.find_element_by_xpath("/html/body")
        link.click()
        driver.quit()
     urlFile.close()
Reply


Messages In This Thread
Invalid argument error thrown. - by pyseeker - Sep-09-2019, 09:44 PM
RE: Invalid argument error thrown. - by luoheng - Sep-10-2019, 03:26 AM
RE: Invalid argument error thrown. - by pyseeker - Sep-10-2019, 04:55 AM
RE: Invalid argument error thrown. - by Malt - Sep-10-2019, 05:26 AM
RE: Invalid argument error thrown. - by pyseeker - Sep-10-2019, 07:03 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Strange argument count error rowan_bradley 3 850 Aug-06-2023, 10:58 AM
Last Post: rowan_bradley
  error: invalid command 'egg_info' TimTu 0 1,079 Jul-27-2023, 07:30 AM
Last Post: TimTu
  Invalid argument: 'images\x08ackground.jpg' CatBall 4 1,112 Jun-19-2023, 09:28 AM
Last Post: CatBall
  which exception should be thrown for a sequence of the wrong length? Skaperen 1 935 Jan-06-2023, 04:13 AM
Last Post: deanhystad
  [ERROR] ParamValidationError: Parameter validation failed: Invalid type for parameter gdbengo 3 11,821 Dec-26-2022, 08:48 AM
Last Post: ibreeden
  Invalid format specifier Error Led_Zeppelin 2 8,295 Jul-11-2022, 03:55 PM
Last Post: Led_Zeppelin
  Error: _vhstack_dispatcher() takes 1 positional argument but 9 were given alexfrol86 3 6,075 May-09-2022, 12:49 PM
Last Post: deanhystad
Exclamation Invalid syntax error(Predict Ethereum Price) lulu43366 2 3,288 Sep-24-2021, 01:24 PM
Last Post: lulu43366
  Unexplained Invalid syntax Error cybertooth 5 3,452 Aug-02-2021, 10:05 AM
Last Post: cybertooth
  [split] [Errno 22] Invalid argument Junaid 0 2,366 Jun-12-2021, 06:02 PM
Last Post: Junaid

Forum Jump:

User Panel Messages

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