检索 get 请求数组
我正在寻找一种方法来检索来自与我没有任何隶属关系的特定网站/链接的 get 请求的 URL。我一直在使用 PHP,但它确实不起作用。我很确定下面的代码正在获取索引页本身的信息。不是 get 请求,因为页面需要加载才能发起 get 请求,而且我不知道如何“加载”页面而无需在浏览器中实际访问该页面...如果您在任何情况下给我任何线索编程语言将会有很大的帮助。
$url = 'http://apple.com';
echo "<pre>";
print_r(get_headers($url, 1));
echo "</pre>";
这就是我想要的数组(只是 URL/文件名):
对于某些东西,例如 简单 HTML Dom 解析器 和 cURL 我在想可能有办法。如果有另一种语言可以做到这一点,我很想知道。
I am looking for a way to retrieve the URLs of the get requests from a specific website / link that I do not have any affiliation with. I've been using PHP and its really not working out. I am pretty sure the code below is getting the information of the index page itself. Not the get requests because the page needs to load to even initiate get requests, and I don't know of a way to "load" a page without actually going to it in a browser... If you give me any lead within any programming language it would be a great help.
$url = 'http://apple.com';
echo "<pre>";
print_r(get_headers($url, 1));
echo "</pre>";
This is what I want an array of (just the URL's / filenames):
With certain things like Simple HTML Dom Parser and cURL I was thinking there might be a way. If there is another language that can do this I would love to know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为这是可能的,因为是浏览器发出这些请求。
PHP 代码在服务器端运行,不加载图像、javascript、css 等。
I dont thins this is possible as it is the browser that makes those request.
The PHP code is run on server side and does not load images, javascript, css etc.