0

I want to scrapy this link

http://services.geospatial.org.tw/maploc/

I'd learned how to use scrapy to request a form

    yield FormRequest.from_response(response,
                                    formname=' ',
                                    formdata={ },    
                                    callback=self.parse)    

But this is use javascript to control the click (<input type="button" value="查詢" onclick="codeAddress()">)
It didn't have form
how can I do to scrpay this link??
Please help me, thank you

MANOJ GOPI
  • 1,279
  • 10
  • 31
user2492364
  • 6,543
  • 22
  • 77
  • 147
  • Have you tried using Selenium Webdriver ? – aberna Jan 15 '15 at 08:16
  • I know selenium.but it will take more time to crawl. SO I want to know is there any way scrapy can do it. – user2492364 Jan 15 '15 at 08:24
  • yeah performance could be an issue. On the other hand the code for dealing it with Selenium would be easy. By my knowledge scrapy alone is not able to interact with javascripts – aberna Jan 15 '15 at 08:32
  • 1
    You can inspect network activity in your favorite browser's Dev Tools panel, look at what HTTP requests are made when you click on that button. When I enter "taipei" for example, I can see that there's a GET request for `https://maps.googleapis.com/maps/api/js/GeocodeService.Search?4staipei&7sUS&9sen-US&callback=_xdc_._2e312p&token=46610`, which returns some Javascript data, with an object – paul trmbrth Jan 15 '15 at 08:40
  • so how to use get in scrapy? – user2492364 Jan 15 '15 at 23:42
  • Possible duplicate of [Click a Button in Scrapy](http://stackoverflow.com/questions/6682503/click-a-button-in-scrapy) – Ali Hesari Apr 11 '17 at 21:19

0 Answers0