<li class='test-li' li-data="<?= $country['city_name'] ?>" ><?php
if($country["highway"] == 1 || 2 || 3 || 4) echo $country["id"];?></li>
$('body').on('click' , '.test-li', function(){
alert($(this).attr('li-data'));
});
class ExampleSpider(scrapy.Spider):
name = 'example'
headers = {
'Accept': '*/*',
'Accept-Encoding': 'gzip, deflate, br',
'Cache-Control': 'no-cache',
'Accept-Language': 'ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3',
'Connection': 'keep-alive',
'Pragma': 'no-cache',
'USER_AGENT': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36'
}
def start_requests(self):
url = 'http://www.booking.com'
yield scrapy.Request(url=url, headers=self.headers, callback=self.parse)
def parse(self, response):
print('step 2')
print(response.status)
print(response.headers)
open_in_browser(response)