Spaces:
Sleeping
Sleeping
Update main.py
Browse files
main.py
CHANGED
@@ -46,7 +46,7 @@ async def fast_scrape(url: str):
|
|
46 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
47 |
}
|
48 |
# Step 1: Send a request to the webpage
|
49 |
-
response = requests.get(url, headers=headers)
|
50 |
|
51 |
# Step 2: Parse the HTML content using BeautifulSoup
|
52 |
soup = BeautifulSoup(response.content, 'html.parser')
|
|
|
46 |
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'
|
47 |
}
|
48 |
# Step 1: Send a request to the webpage
|
49 |
+
response = requests.get(url, headers=headers,timeout=2)
|
50 |
|
51 |
# Step 2: Parse the HTML content using BeautifulSoup
|
52 |
soup = BeautifulSoup(response.content, 'html.parser')
|