Home > Backend Development > PHP Tutorial > 用phpquery采集的问题

用phpquery采集的问题

WBOY
Release: 2016-06-23 14:17:52
Original
1148 people have browsed it

我用phpquery采集网页的内容

以下是

phpQuery::newDocumentFile($url); $img=pq('.productImageGrid #prodImageCell')->html();echo $img;$img_txt=pq('.productImageGrid #prodImageCell')->text();
Copy after login


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


用phpquery采集的问题

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


回复讨论(解决方案)

 

&rank=&price=imgurl=">

现在不知道怎么输出$img ,因为要存入数据库的
$img 类型是string的

既然是字符串直接存入数据库就是了

 

&rank=&imgurl=¤cy=">

请问我怎么输出给imgurl=
我直接用ehco,就在页面上显示图片了
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template