Локально парсер работает правильно, но на heroku он возвращает пустой список.
Парсер:
import requests
from bs4 import BeautifulSoup
def parser_links():
URL = 'https://site.com/'
HEADERS = {
'User-Agent': 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.141 Safari/537.36',
}
response = requests.get(URL, headers=HEADERS)
soup = BeautifulSoup(response.content, 'html.parser')
items = soup.findAll('div', class_='download')
comps = []
for item in items:
if item.find('a', href=True)['href'][0] == '/':
comps.append(
item.find('a', href=True)['href']
)
return comps
response.content
приходит. Мб тот сайт препятствует работе с heroku, смотря на ipResponse 403
.