How does php capture data on webpages-php Tutorial

Source: Internet
Author: User
How does php capture data on a webpage? For example, a website contains personal names, addresses, phone numbers, and languages. I want to use a program to capture information about the situation, but there are more than one language, two or three! And save them. & nbsp; could you tell me how to use PHP to implement this function? You 'd better check the code directly !. ------ Solution -------------------- how can cur php capture data on webpages?
For example, a website contains personal names, addresses, phone numbers, and languages.
I want to use a program to capture information about the situation, but there are more than one language, two or three! And save them.

How can I use PHP to implement this function? You 'd better check the code directly !.

------ Solution --------------------
Available curl or file_get_contents
Will read the html code of the target website, and then you need to write regular expressions based on the code to extract what you want
No specific webpage is not good for example
------ Solution --------------------
Curl + regular
------ Solution --------------------
I remember you asked the locomotive before. In fact, this code can be intercepted by the engine. of course, you can use crul + regular expressions. for regular expressions, refer to the 4 th floor. However, it seems that <, "the characters must be escaped, try it by yourself. just output it and check it out.
------ Solution --------------------
String truncation
------ Solution --------------------
Write regular expression!
------ Solution --------------------
Use htmldom to parse data from curl
------ Solution --------------------
Discussion

Can you give me some details! I still don't understand it! Php is basically ignorant'
Can you write the code about curl to me! Thank you !!!!!!!!!!
Can this curl + regular expression be directly used in the interface plug-in of the locomotive collector?

------ Solution --------------------
CURL and Baidu. There are a lot of data usage. Regular expressions have nothing to do with PHP and are available in any language!
I suggest that you study what you have learned for a lifetime, and improve your self-solving capability. if you encounter any code faults during actual operations, post a post for discussion, which is more in line with the spirit of a scholar! For reference only. Haha!
------ Solution --------------------
Curl + regular
------ Solution --------------------
Read remote URLs
Then match with the regular expression
Expected result
You can save it to a database or file.
------ Solution --------------------
Let me explain your thoughts. you have to study it.
The above has already been very specific to you!
Study Now
------ Solution --------------------
Generally, Curl + regular expressions are used. Currently, I am using an open-source java program. For more information, see.
I used this in my blog and captured the Naruto cartoon.
Http://web-harvest.sourceforge.net/index.php

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.