summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gsearch.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/gsearch.py b/gsearch.py
index 12e2902..6408f1e 100644
--- a/gsearch.py
+++ b/gsearch.py
@@ -13,3 +13,9 @@ def gsearch(q='',num=10,datelimit=''):
returninfo.append({'href':a.values()[0],'text':a.text})
return returninfo
+def gs(xpath):
+ returninfo = []
+ content = (open("tests/science-direct-search-results.html","r")).read()
+ tree = et.fromstring(content, et.HTMLParser())
+ links = tree.xpath(xpath)
+ return links