Skip to content

Commit

Permalink
Update scraper.py
Browse files Browse the repository at this point in the history
  • Loading branch information
danozgriff committed Dec 11, 2015
1 parent f7be9ac commit 1e4c394
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions scraper.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@

#data = scraperwiki.scrape("http://www.asx.com.au/asx/research/ASXListedCompanies.csv")
#url2 = 'https://www.aussiebulls.com/SignalPage.aspx?lang=en&Ticker=WOW.AX'
br = mechanize.Browser()
br = mechanize.Browser()

# sometimes the server is sensitive to this information
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]
br.addheaders = [('User-agent', 'Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008071615 Fedora/3.0.1-1.fc9 Firefox/3.0.1')]

#####reader = csv.DictReader(data.splitlines()[2:10])

Expand Down Expand Up @@ -53,17 +53,17 @@
#####for record in reader:
##### print record

response = br.open(url)
response = br.open(url)

for pagenum in range(1):
html = response.read()
for pagenum in range(1):
html = response.read()

#comp = re.search(r'MainContent_CompanyTicker(\w{3,}\.AX)span', html).group(0)
#ASX_Code = '3PL.AX'

#print re.findall(r'MainContent_signalpagehistory_PatternHistory24((.)+)\<\\table\>', html)
test1 = re.search(r'Day\'s Volume(.*?)>(.*?)<(.*?)endcol', html)
print test1
test1 = re.search(r'Day\'s Volume(.*?)>(.*?)<(.*?)endcol', html)
print test1

# if test1:
# test1 = test1.group(0)
Expand Down

0 comments on commit 1e4c394

Please sign in to comment.