Hi Guys, 

I am new to scrapy and so having problem in submitting form. Basically i 
want to grab some information from the following website. 
http://www.att.com/maps/store-locator.html

However before it generates data you need to enter zip code and submit the 
form. 

I am trying to submit the form, however not sure how to figure out which 
parameter I have to send.  Following is my code, if someone would tell what 
I am doing wrong it would be a great help. 

from scrapy.spider import BaseSpider
from scrapy.selector import Selector
from scrapy.http import FormRequest


class boostMobile(BaseSpider):
 name = "boostMobile"
 start_urls = ["http://www.att.com/maps/store-locator.html#fbid=FB5otmVCcDK";
]
 
 def start_requests(self):
 return [FormRequest(
"http://www.att.com/maps/store-locator.html#fbid=FB5otmVCcDK";,
                        formdata={'searchTxt': '10025'},
                        callback=self.logged_in)]
 def logged_in(self, response):
 sel = Selector(response)
 company = sel.xpath("//*[@id='searchResultItem_0']/div[2]/p[1]/text()")
 print company.extract()

When I run the above code I am getting following error .
DEBUG: Retrying <POST 
http://www.att.com/maps/store-locator.html#fbid=FB5otmVCcDK> (failed 1 
times): 503 Service Unavailable
DEBUG: Retrying <POST 
http://www.att.com/maps/store-locator.html#fbid=FB5otmVCcDK> (failed 2 
times): 400 Bad Request
DEBUG: Gave up retrying <POST 
http://www.att.com/maps/store-locator.html#fbid=FB5otmVCcDK> (failed 3 
times): 503 Service Unavailable


-- 
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/groups/opt_out.

Reply via email to