English 中文(简体)
PHP网络拖网、数据结构和储存,是否与PHPC的拖网合作?
原标题:PHP web crawler, data structure and storage, Will it work with PHPCrawl?

If there are other classes written to do this, a link would be awesome. If not, how can I do it with PHPCrawl?

是否有可能根据该场址的一套具体规则,从一个无计划场址储存具体信息? Ex., [div.want this, img#defaultPicture]?

在PHPC的拖网中,我如何能够从<代码>$_data阵列中获取这一信息?

http://www.ohchr.org。

只能针对某些因素。

不妨将数据储存规则从一个变量(可以是一阵列,具体列明指标)。

最佳回答

你们要求的是,如何利用PHPC的扩展将A站点的具体内容和B站点的其他具体内容混为一谈。

可在以下网址上填写:

for url in urls:
    content = crawl(url)
    if(url of type 1?):
        extract_style1(content)
    else-if(url of type 2?):
        extract_style2(content)
    else:
        extract_styledefault(content)


For specific content extracting following algo can be used:

Note: There are spectrum of parsing techniques avaliable, I am implmeneting HTML DOM Parsing here..

// Create DOM from your PHP Crawl Data Source
$html = $page_data[source]

// Find all images 
foreach($html->find( img ) as $element) 
       echo $element->src .  <br> ;

// Find all links 
foreach($html->find( a ) as $element) 
       echo $element->href .  <br> ;

Reference:

HTML DOM
PHPCrawl Example

问题回答

暂无回答




相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签