Hi All,

I want to "Workshop Discussions" value in this URL(
http://steamcommunity.com/workshop/discussions/?appid=220700). For this I 
wrote like scrapy code like this. But I was unable to extract "70" which is 
Workshop Discussions count.

from scrapy.selector import HtmlXPathSelector
from scrapy.spider import BaseSpider
from extractDiscussionsCount.items import ExtractdiscussionscountItem

class ScrapePriceSpider(BaseSpider):
    
    name = 'ScrapeDiscussionsCount'     
    allowed_domains = ['steamcommunity.com']    
    start_urls = 
["http://steamcommunity.com/workshop/discussions/?appid=220700";]
    
    def parse(self, response):
           
            hxs = HtmlXPathSelector(response)
            currentDate = datetime.datetime.now()
            currentTime = str(datetime.datetime.now().time())
            items = []    
            item = ExtractdiscussionscountItem()       
            
*            workshopDiscussions= 
hxs.select("//div[@class='forum_list_name']/a[contains(.,'Workshop')]/preceding-sibling::text[][1]").extract()*
                        
            item["DiscussionCount"] = str(workshopDiscussions)             
            items.append(item)
            return items
  

I know there is xpath issue with red colored text in the above code. Please 
help me in writing this. 

Thanks
Chetan Motamarri

-- 
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