linkGrabber Testing

1
2
"""linkGrabber Testing."""
from linkGrabber import Links
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

1 Response

```

from linkGrabber import Links
import csvmodule as c
import ToolBox
import json

search = raw_input("ENTER SEARCH TERM: ").replace(" ",'%20')

links = Links(" http://ios.25pp.com/search/" + search)
apps = links.find("a", href=True, duplicates=False)

Results = []
for x in range(len(apps)):
app = apps[x]
if 'target' in app.keys() and 'title' in app.keys():
TempDict = {}
TempDict['title'] = app['title']#.encode("UTF-8",'ignore')
TempDict['appurl'] = app['href']#.encode("UTF-8",'ignore')
Results.append(TempDict)

print Results

j = open("25ppJSON.txt",'w')
js = json.dumps(Results)
j.write(js)
#c.WriteCSV("25pp",Results)
```

Write a comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.