Why did the "Python" XPath get an error after pasting in the code? How do you find the positioning point exactly when locating the element?

Source: Internet
Author: User
Tags xpath

1. After the XPath () double quotation mark ("") inside cannot apply the double quotation mark (""), the inside double quotation mark ("") to the single quotation mark ("") the error is gone.

2. How can I find the positioning point exactly when locating the element?

To skillfully apply F12, determine the page element to be positioned, and see if the element-related attribute value is unique in the code in the page (if there is an ID value that can be used to locate the ID value, the ID value in the General page is unique), otherwise it can be ctrl+f will be ready to try to locate the attribute value of the element search to see if the page has the same value, if there is not to use this attribute value to locate, if not then you can use this attribute value positioning ~ This is the secret, very suitable for oh ~

1) below this has 2 duplicate attribute values, so you cannot use this property to locate the element in the page that you want to locate

2) After the search above the red Box 2 of the position is 1 then you can be sure to use this attribute value to locate the front-end page corresponding elements can be successful. For example:

Why did the "Python" XPath get an error after pasting in the code? How do you find the positioning point exactly when locating the element?

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.