开发者

trying to use preg_match_all to get table contents from page

开发者 https://www.devze.com 2023-03-03 19:40 出处:网络
I have an html page and开发者_如何学Python I want to get the contents in a table. the table starts with grid tag and ends with grid tag,

I have an html page and开发者_如何学Python I want to get the contents in a table. the table starts with grid tag and ends with grid tag,

My function is this:

preg_match_all("/<grid>.*<\/grid>/",$page, $matches,PREG_OFFSET_CAPTURE);

I get a null array.


Don't use a regex, use something like QueryPath - I've used it dozens of times with great success. It works like jQuery, for PHP.

0

精彩评论

暂无评论...
验证码 换一张
取 消