Use PHP code from the web page to extract valid image addresses

xiaoxiao2021-03-06  42

Demand: Need to extract some of the addresses from a web page in multiple web pages (such as http: //photo.561203_091835_890_578.jpg), each web page format is fixed, making the same template ( Such as: http://photo.5617.com/show424.aspx, now you already know this address in the specific location of Show424.asp, how to extract it, and generate a list containing full URL addresses. Analysis: Write a program with advanced programming tools such as C ? C I will not, c I will, it is estimated that there is a certain difficulty in using C, it is better to use Delphi, this will be a little bit. I have found some information from the Internet, I still use PHP to complete the line. Test results: I downloaded from the Internet to buy, and then after my own revision, I basically completed my request. Write a PHP to analyze these pages, and extract the picture address from the inside. Stop, isn't it necessary to extract the address from multiple web pages? ! Is there a loop in PHP? It is OK with for or while to a loop. Considering this PHP program needs to read and write these web pages to be processed. If the program is downloaded from the Internet, it is estimated that the execution speed is slow (mainly the speed of the network is not fast, the machine speed is not fast: (), then first Download these web pages in batches (batch download methods I will no longer rose here), put them in the apache's HTDOCS directory established by this unit, and create an enabling executing .php in this machine (created in this machine) A PHP environment, I am not Roso here). Place all the pages downloaded in the PIC directory, open the browser, run this code, the browser will display the full address of these pictures, copy this copy List, find the download tool to download these pictures. The detailed code is as follows: ()) (] (src = /") " $ source); for ($ I = 6; $ I

转载请注明原文地址:https://www.9cbs.com/read-79649.html

New Post(0)