Can't get attribute value which attribute name start with #?
See original GitHub issuefor example, the page source is bellow:
<img src="http://www1.pcbaby.com.cn/images/blank.gif" #src="http://img0.pcbaby.com.cn/pcbaby/1603/10/2799244_yunzaoqi0310-11.jpg" />
But I get next in scrapy:
<img src="http://www1.pcbaby.com.cn/images/blank.gif" />
I can’t get the attribute “#src” in scrapy.
How can I get that? please help me! Hope your reply! thanks!
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
get attribute name in addition to attribute value in xml
I tried to make a simple example, I can get the attribute values i.e. "myName", "myNextAttribute", and "blah", but I can't get the...
Read more >Element.getAttribute() - Web APIs | MDN
The getAttribute() method of the Element interface returns the value of a specified attribute on the element.
Read more >How to Access an Object Attribute Given the Attribute Name as ...
You first create a Gun class object. Second, you get its caliber and color. Since your object does not have an attribute called...
Read more >.attr() | jQuery API Documentation
Description: Get the value of an attribute for the first element in the set of matched elements. version added: 1.0.attr( attributeName ). attributeName....
Read more >HTML data-* Attribute - W3Schools
The attribute name should not contain any uppercase letters, and must be at least one character long after the prefix "data-" · The...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
lxml/libxml2
has trouble with this input, buthtml5lib
andbeautifulsoup
can cope (although with some specificities on the XPath expression to use)Plain lxml:
Let’s try with
html5lib
It seems
html5lib
has the attribute accessible using “U00023src”, not “#src”. And you need to pass namespaceLet’s try with beautifulsoup parser
ok, thank you very much!