0

I tried to run this code in python but got the following error:

TypeError: main.checkout() argument after * must be an iterable, not WebDriver

def checkout():
  browser.get("https://google.com")

for i in range(5):
browserThread = threading.Thread(target = checkout, args = (webdriver.Chrome()))
browserThread.start()

2 Answers 2

1

I think the error is saying that it's expecting a args to be a tuple. You should also add your argument in checkout and reference browser that way.

I think you'd set args like this:

... args=((webdriver.Chrome()),)

Sign up to request clarification or add additional context in comments.

Comments

1
def checkout(browser, url):
    browser.get(url)

for i in range(5):
    browserThread = threading.Thread(target=checkout, args=(webdriver.Chrome(), 'https://www.google.com'))
    browserThread.start()

And ensure executable file 'Chrome driver' is available in any PATH.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.