Last active
March 26, 2017 22:01
-
-
Save tkovs/58a93c4c5fc06968e8d41d247a229683 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scrapy | |
class ranking(scrapy.Spider): | |
name = 'ranking' | |
allowed_domains = ['yugiohrpgonline.com.br'] | |
start_urls = ['https://www.yugiohrpgonline.com.br/clan/SET/ranking/week/'] | |
def parse(self, response): | |
formdata = { | |
'login': 'user', | |
'password': 'pass', | |
'g-recaptcha-response': '' | |
} | |
# Linha abaixo retorna "Yu-Gi-Oh RPG Online - Efetuar Login" | |
self.logger.warning(response.xpath('//title/text()').extract_first()) | |
return scrapy.FormRequest.from_response( | |
response, | |
formnumber = 0, | |
formdata = formdata, | |
callback = self.after_login | |
) | |
def after_login(self, response): | |
# Linha deveria retornar "Yu-Gi-Oh RPG Online - Ranking SET", mas retorna mesma coisa que o warning anterior | |
self.logger.warning(response.xpath('//title/text()').extract_first()) | |
return |
kaihami
commented
Mar 26, 2017
•
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment