Re: [Tutor] Problem getting data using beautifulsoup4 + python 3.4.1

2014-09-18 Thread Juan Christian
On Thu, Sep 18, 2014 at 6:10 PM, Peter Otten <__pete...@web.de> wrote: > > The doesn't have an href attribute, its child has. Try > > [a.attrs["href"] for a in s.select("div.authorline a")] OMG, I completely forgot about the 'a'... http://goo.gl/A8sRLT Thanks! 100% Working. ___

Re: [Tutor] Problem getting data using beautifulsoup4 + python 3.4.1

2014-09-18 Thread Peter Otten
Juan Christian wrote: > My code: > > import requests > import bs4 > > > FORUM_ID = "440" > > response = requests.get(' > http://steamcommunity.com/app/{id}/tradingforum'.format(id = FORUM_ID)) > soup = bs4.BeautifulSoup(response.text) > topics = [a.attrs.get('href') for a in > soup.select('a.f

[Tutor] Problem getting data using beautifulsoup4 + python 3.4.1

2014-09-18 Thread Juan Christian
My code: import requests import bs4 FORUM_ID = "440" response = requests.get(' http://steamcommunity.com/app/{id}/tradingforum'.format(id = FORUM_ID)) soup = bs4.BeautifulSoup(response.text) topics = [a.attrs.get('href') for a in soup.select('a.forum_topic_overlay')] for topic in topics: r = r