Closed
Description
Description
UserWarning: Selector got both text and root, root is being ignored.
Only happens on Ubuntu
Steps to Reproduce
- Open a simple python shell
- Paste code below
- Run it
from scrapy.selector import Selector
link = "<a class='fsm fwn fcdg' target='_blank' href='/ta/id/340639-par-olaines-novada-domes-2009-gada-30-septembra-sedes-lemuma-apstiprinato-saistoso-noteikumu-nr-76-par-detalplanojuma-apstiprinasanu'>Par Olaines novada domes 2009. gada 30. septembra sdes lmum apstiprinto saistoo noteikumu Nr. 76 'Par detlplnojuma apstiprinanu nekustamajam paumam 'Vrpas' (kad. Nr. 8080 008 0095)', pielikuma Nr. 66 atcelanu</a>"
selector = Selector(text=link, type='html')
Warning output:
/home/iamuser/.local/share/virtualenvs/myenv-YA2UsV5L/lib/python3.11/site-packages/scrapy/selector/unified.py:83: UserWarning: Selector got both text and root, root is being ignored.
super().__init__(text=text, type=st, root=root, **kwargs)
Expected behavior: No warnings? It's quite strange because it doesn't appear on MacOS and Windows
Actual behavior: Shows warning message above
Reproduces how often: 100% on Ubuntu
Versions
Please paste here the output of executing scrapy version --verbose
in the command line.
Scrapy : 2.8.0
lxml : 4.9.2.0
libxml2 : 2.9.14
cssselect : 1.2.0
parsel : 1.8.1
w3lib : 2.1.1
Twisted : 22.10.0
Python : 3.11.2 (main, Feb 7 2023, 13:52:42) [GCC 11.3.0]
pyOpenSSL : 23.1.1 (OpenSSL 3.0.8 7 Feb 2023)
cryptography : 39.0.1
Platform : Linux-5.15.0-69-generic-x86_64-with-glibc2.35
Additional context
Why does this warning appear on ubuntu? I tried running it on MacOS and Windows and it doesn't appear. Is this something of a concern? I believe this should be supressed. Thanks!
Metadata
Metadata
Assignees
Labels
No labels