Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
html链接是:
<a title="Next page of results" class="sprBtnSRP1 enabled" href="http://www.link.com/page.html?thisisthelink&_pgn=2&_al=25&at=t
翻译自:https://stackoverflow.com/questions/11765297 2012-08-01T18:26:49.150 411 次 This question shows research effort; it is useful and clear 1 This question does not show any research effort; it is unclear or not useful Bookmark this question. Show activity on this post. phphyperlinkhrefextract 4 1 回答 1 This answer is useful 0 试试这个模式: $urlpattern1 = '/<a\s+.*?href=".*?_pgn=(.*?)".*?>/i'; 编辑 : 如果您只想要那个链接,那么您可以使用标题(或其他参数)作为提示,试试这个模式: $urlpattern1 = '/<a\s+.*?title="Next page of results"\s+.*?href=".*?\_pgn=(.*?)".*?>/i'; 于 2012-08-01T18:32:49.590 回答 Related 5 python - Python将格式不一致的文本加载到数组中 1 hibernate - 如何使用对象的大小在数据表中动态添加列 5 jquery - 停止关闭悬停时的下拉菜单 1 windows-phone-7 - How to separate the files from Google Drive in the Response only using Rest API 1 php - 从 php 文件中读取 1000 字节的块 0 css - Extjs 4.2.1 中的样式自定义类 1 javascript - Dynamically building MongoDB queries in NodeJS 1 c++ - 在 Qt 中监控应用程序网络流量 3 c# - 加密不一样 用同样的方法加密同样的明文 1 java - 默认关闭快捷方式不起作用 Reference php × 1429865 c/c++ × 756500 nginx × 49975 mongodb × 159057 mybatis × 3233 anaconda × 13410 pycharm × 14671 python × 1902243 vscode × 56040 docker × 110988 github × 49000 flask × 49129 ffmpeg × 24037 jmeter × 16910 matplotlib × 63493 bootstrap × 54641
试试这个模式:
$urlpattern1 = '/<a\s+.*?href=".*?_pgn=(.*?)".*?>/i';
编辑 :
如果您只想要那个链接,那么您可以使用标题(或其他参数)作为提示,试试这个模式:
$urlpattern1 = '/<a\s+.*?title="Next page of results"\s+.*?href=".*?\_pgn=(.*?)".*?>/i';