如何在 PHP 中实现屏幕抓取工具? [英] How do I implement a screen scraper in PHP?

查看:36
本文介绍了如何在 PHP 中实现屏幕抓取工具?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户 ID 和密码,可以通过我的程序登录网站.登录后,URL 将从 http://localhost/Test/loginpage.html 更改为 http://www.4wtech.com/csp/web/Employee/Login.csp.

I have a user ID and a password to log in to a web site via my program. Once logged in, the URL will change from http://localhost/Test/loginpage.html to http://www.4wtech.com/csp/web/Employee/Login.csp.

如何使用 PHP 从第二个 URL 中屏幕抓取"数据?

How can I "screen scrape" the data from the second URL using PHP?

推荐答案

您将使用 Curl.Curl 可以登录该页面,然后访问新的引用页面并下载整个页面.

You would use Curl. Curl can login to the page, then access the new referred page and download the entire page.

查看curl的php手册以及本教程:如何使用 PHP 和 Curl 进行屏幕抓取.

Check out the php manual for curl as well as this tutorial: How to screen-scrape with PHP and Curl.

这篇关于如何在 PHP 中实现屏幕抓取工具?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆