Thanks dude. 

On Monday, February 9, 2015 at 1:17:15 AM UTC-7, Mathias Verhoeven wrote:
>
> Hi Chetan,
>
> Have you correctly indented your parse method?
> It needs to be a member of your MySpider class.
> See: http://doc.scrapy.org/en/latest/topics/spiders.html#spider-example
>
> Mathias
>
> On Monday, 9 February 2015 07:29:29 UTC+1, Chetan Motamarri wrote:
>>
>> Hello All,
>>
>> I want to scrape data in "topics_html" attribute of 
>> http://steamcommunity.com/forum/3381077/General/render/0/?start=0&count=10. 
>> It is in JSON. My below script is throwing error as shown in 
>> attachment(Error.JPG). I was unable to figure out where the issue is. 
>> Please correct me if I am doing any wrong.
>>
>>
>> from scrapy.spider import BaseSpider
>> import json
>>
>> class MySpider(BaseSpider):
>>     name = "discussions"
>>     allowed_domains = ["steamcommunity.com"]
>>     start_urls = ['
>> http://steamcommunity.com/forum/3381077/General/render/0/?start=0&count=1
>> ']
>>
>> def parse(self, response):
>>     jsonresponse = json.loads(response.body_as_unicode())
>>     topics_html = jsonresponse["topics_html"]
>>     print topics_html
>>
>  
>

-- 
You received this message because you are subscribed to the Google Groups 
"scrapy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/scrapy-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to