Sto imparando Scrapy, una struttura di scansione del web.Come rendere Scrapy show user agent per richiesta di download nel log?
So che posso impostare USER_AGENT
nel file settings.py
del progetto Scrapy. Quando eseguo Scrapy, posso vedere il valore di USER_AGENT
nei registri INFO
.
Questo USER_AGENT
viene impostato in ogni richiesta di download sul server che si desidera sottoporre a scansione.
Ma sto usando più USER_AGENT
in modo casuale con l'aiuto di this solution. Immagino che questo USER_AGENT
scelto a caso funzionerebbe. Voglio confermarlo. Quindi, come posso fare Scrapy mostraUSER_AGENT
per richiesta di download in modo da poter vedere il valore di USER_AGENT
nei registri?
Ma perché non l'ha aggiunto a PyPI? – theotheo
@theotheo done, consultare https://pypi.python.org/pypi/scrapy-fake-useragent. Grazie per l'idea. – alecxe
@alecxe Sto usando fake-useragent nel mio progetto ma sta lanciando "raise FakeUserAgentError ('Errore durante il recupero del browser') # noqa FakeUserAgentError: Errore durante il recupero del browser" Errore. – javed