-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhelper.py
More file actions
30 lines (20 loc) · 713 Bytes
/
helper.py
File metadata and controls
30 lines (20 loc) · 713 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
from bs4 import BeautifulSoup
import requests
A_G = "http://www.upto75.com/Adventure_Gaming/145/Shopping_Deals.html"
main = "http://www.upto75.com/Adventure_Gaming/"
URL = "/Shopping_Deals.html"
Req = requests.get(A_G)
Soup = BeautifulSoup(Req.content)
id = Soup.find_all( "select", { "name":"src_category"} , {"id":"src_category"} )
id = id[0].find_all("option")
id.reverse()
CURLS = []
cfile = open("Cats.txt",'w')
for i in id :
cat_ = i.text.encode('utf-8')
CURLS.append(main+str(i.get("value")) + URL + "<=>"+cat_ )
print "found " + CURLS[-1]
cfile.write(CURLS[-1]+"\n")
cfile.close()
open("processedURLS.txt",'a').close()
raw_input("\n\nPress Enter to close")