Skip to content

Commit

Permalink
3.1.0: Exclude ads from search results
Browse files Browse the repository at this point in the history
  • Loading branch information
alissonlauffer committed Sep 3, 2020
1 parent 53d6c18 commit 650cbe7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions duckpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def parse_page(html: Union[str, bytes]):
soup = BeautifulSoup(html, "html.parser")
results = []
for i in soup.find_all('div', {'class': 'links_main'}):
if i.find('a', {'class': 'badge--ad'}):
continue
try:
title = i.h2.a.text
description = i.find('a', {'class': 'result__snippet'}).text
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name='duckpy',
version='3.0.0',
version='3.1.0',

packages=['duckpy', 'duckpy.aio'],
install_requires=['beautifulsoup4>=4.9.1', 'httpx[http2]==0.14.*'],
Expand Down

0 comments on commit 650cbe7

Please sign in to comment.