Spaces:
Sleeping
Sleeping
Update tools.py
Browse files
tools.py
CHANGED
|
@@ -41,7 +41,7 @@ class VisitWebpageTool(Tool):
|
|
| 41 |
|
| 42 |
def forward(self, url: str) -> str:
|
| 43 |
try:
|
| 44 |
-
#
|
| 45 |
headers = {
|
| 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 |
}
|
|
|
|
| 41 |
|
| 42 |
def forward(self, url: str) -> str:
|
| 43 |
try:
|
| 44 |
+
# fake user-agent to avoid 403 Forbidden errors
|
| 45 |
headers = {
|
| 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 |
}
|