dsfhe34889789708 2015-05-07 06:41
浏览 54

如何使用PHP从html中提取数据

I am trying to get data(like job vacancy) from page like http://www.quest.edu.pk/jobs/.I dont know how to get this.can anyone help me in doing this. Thanku in advance.

  • 写回答

1条回答 默认 最新

  • duanhoupeng6642 2015-05-07 07:02
    关注

    php has inbuilt function file_get_contents to extract complete html source of webpage - like below:

    $html=file_get_contents("http://www.quest.edu.pk/jobs/")
    

    But its not recommended because we can not set timeout parameter in function. So instead of this you can use curl library and preg_match as suggested by @Sunil Pachlangia & @Noman.

    you can refer this Link for more information.

    评论

报告相同问题?