Heim  >  Artikel  >  Backend-Entwicklung  >  用phpquery采集的有关问题

用phpquery采集的有关问题

WBOY
WBOYOriginal
2016-06-13 12:38:24830Durchsuche

用phpquery采集的问题
我用phpquery采集网页的内容

以下是

<br />
phpQuery::newDocumentFile($url); <br />
$img=pq('.productImageGrid #prodImageCell')->html();<br />
echo $img;<br />
$img_txt=pq('.productImageGrid #prodImageCell')->text();<br />


$img_txt是空值,没内容
$img 不管是echo还是print_r都是显示图片
请问$img怎么转成字符串,我需要存入数据库。


 用phpquery采集的有关问题

以上为浏览器里面显示的代码,我就想这些代码存入数据库。

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn