When I run this piece of code copied directly from the documentation:
from botasaurus.request import request, Request
from botasaurus.soupify import soupify
@request
def scrape_heading_task(request: Request, data):
# Visit the Omkar Cloud website
response = request.get("https://www.omkar.cloud/")
# Create a BeautifulSoup object
soup = soupify(response)
# Retrieve the heading element's text
heading = soup.find('h1').get_text()
# Save the data as a JSON file in output/scrape_heading_task.json
return {
"heading": heading
}
# Initiate the web scraping task
scrape_heading_task()
I get the following error:
TypeError: Request.__init__() accepts 1 to 2 positional arguments, but was given 3
I fixed changing the init method of Request class in request_class.py:
please run
python -m pip install bota botasaurus botasaurus-api botasaurus-requests botasaurus-driver bota botasaurus-proxy-authentication botasaurus-server --upgrade
to fix this
I have installed the latest version 4.0.34
When I run this piece of code copied directly from the documentation:
I get the following error:
TypeError: Request.__init__() accepts 1 to 2 positional arguments, but was given 3
I fixed changing the init method of Request class in request_class.py: