正则-智能建立网址列表程序意外停止但不出现错误?
正则php咨询
最近想用PHP写一个收集站内网址列表的程序,如果要是为每个独立的网站都配置单独的规则程序就显得不够智能,所以想一次性写一个智能点的,我的思路是,程序从一个入口进入“www.xxx.com”后用FILE_GET_CONTENT 或CURL获取该页的HTML,然后通过正则分析出所有的链接保存到数组中。
这个时候问题就出现了,因为HTML写法问题,会出现很多情况,下面举例说明。
标题
标题
标题
标题
标题
标题
标题
等等吧,还有很多情况就不逐一写出来了,由于FILE_GET_CONTENT是必须能够访问到该页面才可以返回HTML,但是如果在访问之前不处理的话,就会出现无法访问被跳过的现象,于是我就根据一定情况对上述地址进行拼接使其能够被访问到。
但是我写出的程序依旧不能解决所有问题,而且现在会出现程序没执行完毕就停了,程序不报任何错误,好像结束了一样。
想赖咨询一下,大家有没有什么好的方法去匹配所有情况,因为网址拼接这块是个重点,如果不能有效拼接就无法抓取更多网址,但是通常的拼接不能解决所有情况。
希望大家给予指导。

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

Long URLs, often cluttered with keywords and tracking parameters, can deter visitors. A URL shortening script offers a solution, creating concise links ideal for social media and other platforms. These scripts are valuable for individual websites a

Laravel simplifies handling temporary session data using its intuitive flash methods. This is perfect for displaying brief messages, alerts, or notifications within your application. Data persists only for the subsequent request by default: $request-

This is the second and final part of the series on building a React application with a Laravel back-end. In the first part of the series, we created a RESTful API using Laravel for a basic product-listing application. In this tutorial, we will be dev

Laravel provides concise HTTP response simulation syntax, simplifying HTTP interaction testing. This approach significantly reduces code redundancy while making your test simulation more intuitive. The basic implementation provides a variety of response type shortcuts: use Illuminate\Support\Facades\Http; Http::fake([ 'google.com' => 'Hello World', 'github.com' => ['foo' => 'bar'], 'forge.laravel.com' =>

The PHP Client URL (cURL) extension is a powerful tool for developers, enabling seamless interaction with remote servers and REST APIs. By leveraging libcurl, a well-respected multi-protocol file transfer library, PHP cURL facilitates efficient execution of various network protocols, including HTTP, HTTPS, and FTP. This extension offers granular control over HTTP requests, supports multiple concurrent operations, and provides built-in security features.

Do you want to provide real-time, instant solutions to your customers' most pressing problems? Live chat lets you have real-time conversations with customers and resolve their problems instantly. It allows you to provide faster service to your custom

The 2025 PHP Landscape Survey investigates current PHP development trends. It explores framework usage, deployment methods, and challenges, aiming to provide insights for developers and businesses. The survey anticipates growth in modern PHP versio

In this article, we're going to explore the notification system in the Laravel web framework. The notification system in Laravel allows you to send notifications to users over different channels. Today, we'll discuss how you can send notifications ov
