mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 12:43:09 +01:00
parent
41db069581
commit
7b40bd4fdb
@ -70,13 +70,12 @@ class DDG(callbacks.Plugin):
|
|||||||
res = ''
|
res = ''
|
||||||
for t in soup.find_all('td'):
|
for t in soup.find_all('td'):
|
||||||
if "1." in t.text:
|
if "1." in t.text:
|
||||||
res = t.next_sibling.next_sibling
|
res = t.next_sibling.next_sibling
|
||||||
if not res:
|
if not res:
|
||||||
continue
|
continue
|
||||||
try:
|
try:
|
||||||
# 1) Get a result snippet.
|
# 1) Get a result snippet.
|
||||||
snippet = res.parent.next_sibling.next_sibling.find("td",
|
snippet = res.parent.next_sibling.next_sibling.find_all("td")[-1]
|
||||||
class_="result-snippet")
|
|
||||||
# 2) Fetch the result link.
|
# 2) Fetch the result link.
|
||||||
link = res.a.get('href')
|
link = res.a.get('href')
|
||||||
snippet = snippet.text.strip()
|
snippet = snippet.text.strip()
|
||||||
|
Loading…
Reference in New Issue
Block a user