Javascript-php uses xpath to get the variable value declared in the script on the page?

Source: Internet
Author: User
How does php use xpath to get the variable value declared in the script on the page? {Code...}. for example, if a webpage contains the preceding content, can I retrieve the message value? It is not cost-effective for me to retrieve the message from the entire html segment ...... How does php use xpath to get the variable value declared in the script on the page?

Script var message = 'This is the text to be catch... '; script

For example, if a webpage contains the preceding content and I want to obtain the value of the message, how can this problem be solved?

It is not cost-effective for me to retrieve the message from the entire html segment ......

Reply content:

How does php use xpath to get the variable value declared in the script on the page?

Script var message = 'This is the text to be catch... '; script

For example, if a webpage contains the preceding content and I want to obtain the value of the message, how can this problem be solved?

It is not cost-effective for me to retrieve the message from the entire html segment ......

Isn't it realistic that you can only load a part of a page? at any time, you need to obtain the page completely first. if you don't want to use regular expressions to retrieve the page completely, you can consider using a php library similar to jquery
Https://github.com/tburry/pquery

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.