1
1
mirror of https://github.com/leon-ai/leon.git synced 2024-12-11 09:12:40 +03:00

fix(package/trend): GitHub module new scraping

This commit is contained in:
Louistiti 2019-06-17 18:08:20 +02:00
parent 22a3b223ab
commit 6841493740

View File

@ -57,11 +57,11 @@ def run(string, entities):
try:
r = utils.http('GET', 'https://github.com/trending/' + techslug + '?since=' + since)
soup = BeautifulSoup(r.text, features='html.parser')
elements = soup.select('.repo-list li', limit=limit)
elements = soup.select('article.Box-row', limit=limit)
result = ''
for i, element in enumerate(elements):
repository = element.h3.get_text(strip=True).replace(' ', '')
repository = element.h1.get_text(strip=True).replace(' ', '')
if (element.img != None):
author = element.img.get('alt')[1:]
else: