Re: [Tutor] Unable to retreive the stock code

2015-11-16 Thread Peter Otten
Crusier wrote: > Dear All, > > I am currently trying to download the stock code. I am using Python > 3.4 and the code is as follows: > > from bs4 import BeautifulSoup > import requests > import re > > url = > 'https://www.hkex.com.hk/eng/market/sec_tradinfo/stockcode/eisdeqty.htm' > > def web_

Re: [Tutor] Unable to retreive the stock code

2015-11-16 Thread Cameron Simpson
On 16Nov2015 15:41, Crusier wrote: I am currently trying to download the stock code. I am using Python 3.4 and the code is as follows: [...] for link in soup.find_all("a"): stock_code = re.search('/d/d/d/d/d', "1" ) print(stock_code, '', link.text) [...] I am trying to r

[Tutor] Unable to retreive the stock code

2015-11-15 Thread Crusier
Dear All, I am currently trying to download the stock code. I am using Python 3.4 and the code is as follows: from bs4 import BeautifulSoup import requests import re url = 'https://www.hkex.com.hk/eng/market/sec_tradinfo/stockcode/eisdeqty.htm' def web_scraper(url): response = requests.get(