'the first argument must be callable python schedule for function [duplicate]

Hi I am trying to use schedule but it returns the first argument must be callable. I tried looking into other where they say, I must not use the parentheses. However if I do not use the parentheses how would I pass the var?

It looks like this

schedule.every().day.at("13:42").do(scrape("www.website.com"))

where scrape is a function define as

def scrape(URL):
    items = scrapeModule1(URL)
    return items

If I take out the URL what or how am I supposed to call out the var in the def function?



Solution 1:[1]

Without any knowledge of the framework you are using or the error you get:

schedule.every().day.at("13:42").do(lambda : scrape("www.website.com"))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 gnight