XPath helper:chrome Crawler web analytics tools Chrome plugin graphics and text tutorial

Source: Internet
Author: User
Tags xpath
recently learning to use the Scrapy framework to develop a Python crawler, use XPath to get the URL path. Because there are too many tags in html, it is always hard to find an XPath path, and sometimes error-prone, resulting in wasted time and energy. Looking at an article today, I accidentally saw a spider web analytics tool in chrome that used a sense of feeling, so hopefully it will help more Python crawler enthusiasts and developers. XPath Helper Plug-in Overview What the XPath Helper plug-in is.
The XPath helper is a Chrome browser developer plugin that makes it easy to get XPath for HTML elements with XPath helper installed, and the programmer no longer needs to search the HTML source code and locate some IDs to find the corresponding location to parse the page.
XPath Helper Plug-in feature introduction What is the use of XPath helper plug-ins.
The Google plugin XPath Helper can support the creation of XPath on the page click Elements, using XPath, regular expression, message middleware, and multithreaded scheduling framework (reference) throughout the crawl. XPath is a structured web page element selector that supports list and single node data acquisition, and his benefits can support structured web data crawling.
If we're looking for an XPath path to one or an element, you can hold down SHIFT and move into this one, and the box above will show the XPath path to the element, and the right side will display the parsed text, and we can change the XPath path ourselves. The program also automatically displays the corresponding location, and it is convenient to help us determine whether our XPath statements are written correctly.
XPath Helper Plugin Download installation where the XPath helper plugin can be downloaded. You can find the Chrome crawler plugin from the Chrome App Store, and if your Chrome App store doesn't open, you can download it at the GitHub official site: HTTPS://GITHUB.COM/GOOGLE/XPAF, or download the developer plugin- Chrome Plug-in Network http://www.cnplugins.com/devtool/xpath-helper/download.html

XPath Helper How to install the plug-in.
1. If you can open the Chrome App Store and find the Chrome crawler plugin, just click "Add to Chrome", as shown in the following image:


2. If your Chrome App store doesn't open, you get the Chrome crawler from this site or some other way, then you choose to install the plugin offline. Since the Chrome crawler is CRX format like any other chrome plugin, please refer to the following: How to install it in Google Browser. crx extension of the offline Chrome plugin. What to do if the CRX format plugin cannot be installed offline.
Xpath Helper Plug-in usage instructions1. After you install the XPath helper plugin in your Chrome browser, open a page (for example, Sohu) to copy the XPath for the target page element, as shown in the following illustration:


2. Click Ctrl + Shift + X to activate the XPath Helper's console, and then you can enter the appropriate XPath in the Query text box to debug, and the extracted results will be displayed in the next result text box, as shown in the following illustration:


1. Open a new tab and navigate to your favorite Web page.
2. Press Ctrl-shift-X to open the XPath auxiliary console.
3. Hold down the SHIFT key to the element on the page. The query box is constantly updated to show the element full XPath query below the mouse pointer. The result box appears to the right of the query that evaluates the results.
4. If you want, you can edit the XPath query directly in the console. Any changes will be reflected immediately in the result box.
5. Press Ctrl-shift again-X to close the console

XPath Helper Plug-in Considerations

Although the XPath helper plug-in is very handy, it is not omnipotent, and there are two problems: the 1.XPath Helper automatically extracts XPath from the root path, which almost certainly causes the XPath to be too long and not conducive to maintenance; 2. When retrieving the loop's list data   , XPath Helper is the subscript used to extract each of the data in the list, which is not appropriate for the program batch processing, or the need to artificially modify some similar to the * tag. However, a reasonable use of XPath can still save us a lot of time.

You may be interested in: Excellent chrome plugin recommended Xpath Helper Plugin English introduction
Extract, edit, and evaluate XPath queries with ease.
XPath Helper makes it easy to extract, edit, and evaluate XPath queries on any webpage.

Important:after Installing this extension, your must reload any existing tabs (or restart Chrome) for it to work on those tabs!

Instructions:
1. Open A new tab and navigate to your favorite webpage.
2. Hit ctrl-shift-x to open the XPath Helper console.
3. Hold down Shift as your mouse over elements on the page. The query box would continuously update to show the "full XPath" query for the element below the mouse pointer. The results box to it right would show the evaluated results for the query.
4. If desired, edit the XPath query directly in the console. The results box would immediately reflect any changes.
5. Hit Ctrl-shift-x again to close the console.

One word of caution:when rendering HTML tables, Chrome inserts artificial <tbody> tags into the DOM, which'll con Sequently show up into queries extracted by this extension.
See more XPath helper:chrome Crawler web analytics tool Chrome Plugin pictures

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.