0
I took this code from the internet and changed it a little, to log in to the cpfl site, but when I use the command scrapt crawl myproject
nothing happens and the command scrapy runspider items.py
of the error:
No element find in <200 https://servicosonline.cpfl.com.br/agencia-webapp/>
Can you tell me what’s wrong?
import scrapy
BASE_URL = 'https://servicosonline.cpfl.com.br/agencia-webapp/#/login'
USER_NAME = 'username'
PASSWORD = 'password'
class ShareSpider(scrapy.Spider):
name = "sharespider"
start_urls = ['https://servicosonline.cpfl.com.br/agencia-webapp/#/login']
def parse(self, response):
yield scrapy.FormRequest.from_response(
response,
formxpath='//form[@id="panelMobile"]',
formdata={
'documentoEmail': USER_NAME,
'Password': PASSWORD,
'Action':'1',
},
callback=self.after_login)
def after_login(self, response):
pass
Thanks for the help, very useful, so I want to take the invoices and store in a folder on my pc, logging in of this method you gave me believe that not for sure, but already gave a great whitening for me, thank you very much, I’ll see if I can do by the scrapy yet, I probably can’t because I’m still in it, but I see through Lenium, thanks
– guilherme