Javascript-xpath, how to get the text content of Herf

Source: Internet
Author: User
Keywords Css javascript php python

I'm going to use Scrapy frames to crawl data from a Web site

On the JS console, I used $x('//div[@class="summary"]//div[contains(@class, "tags")]') this command to get the data I wanted, but I had to filter my data.
is the JS result of my console output in the browser

I want to xpath continue to filter, the green box to filter out the data, how to write a xpath statement?

Reply content:

I'm going to use Scrapy frames to crawl data from a Web site

On the JS console, I used $x('//div[@class="summary"]//div[contains(@class, "tags")]') this command to get the data I wanted, but I had to filter my data.
is the JS result of my console output in the browser

I want to xpath continue to filter, the green box to filter out the data, how to write a xpath statement?

$x ('//div[@class = ' summary ']//div[contains (@class, "tags")]/a//text () ')

Not tested.

Use the A/text () to get

  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.