i want to pass the link returned in the response.css to items and then use this value to download my file. But everytime that I yield the dict I recive the following error:
ValueError: Missing scheme in request url: h
My code is:
from scrapy.http import FormRequest
from diarioOficial.items import DiariooficialItem
class Crawl_Diario(scrapy.Spider):
TERRITORY_ID = '12'
name = 'do_acre'
allowed_domains = ['www.diario.ac.gov.br/']
start_urls = [
'http://www.diario.ac.gov.br/'
]
def parse(self, response):
yield DiariooficialItem(
file_urls = response.css("div.edhoje a").attrib['href']
)
How can I fix that error?
My items.py is:
class DiariooficialItem(scrapy.Item):
file_urls = scrapy.Field()```