mirror of
https://github.com/OpenJarbas/PySychonaut.git
synced 2024-12-01 23:59:45 +01:00
SEARCH
This commit is contained in:
parent
df14f2625e
commit
acd29067f5
@ -187,11 +187,7 @@ class Erowid(object):
|
|||||||
report["substance"] = fields[2].getText()
|
report["substance"] = fields[2].getText()
|
||||||
report["date"] = fields[3].getText()
|
report["date"] = fields[3].getText()
|
||||||
report["url"] = base_url + r.find("a")["href"]
|
report["url"] = base_url + r.find("a")["href"]
|
||||||
|
report["exp_id"] = report["url"].split("=")[1]
|
||||||
reports.append(report)
|
reports.append(report)
|
||||||
return reports
|
return reports
|
||||||
|
|
||||||
|
|
||||||
reports = Erowid.search_reports("1P-LSD")
|
|
||||||
print reports[0].keys()
|
|
||||||
for report in reports[:5]:
|
|
||||||
print report["substance"], report["url"], report["date"]
|
|
@ -51,7 +51,7 @@ searching experience reports
|
|||||||
|
|
||||||
output
|
output
|
||||||
|
|
||||||
['date', 'url', 'substance', 'name', 'author']
|
['substance', 'name', 'author', 'url', 'date', 'exp_id']
|
||||||
1P-ETH-LAD https://erowid.org/experiences/exp.php?ID=109647 Dec 9 2016
|
1P-ETH-LAD https://erowid.org/experiences/exp.php?ID=109647 Dec 9 2016
|
||||||
1P-LSD https://erowid.org/experiences/exp.php?ID=108914 Aug 1 2016
|
1P-LSD https://erowid.org/experiences/exp.php?ID=108914 Aug 1 2016
|
||||||
1P-LSD https://erowid.org/experiences/exp.php?ID=108138 Mar 16 2016
|
1P-LSD https://erowid.org/experiences/exp.php?ID=108138 Mar 16 2016
|
||||||
|
Loading…
Reference in New Issue
Block a user