Extract data from website via PHP

后端 未结 6 518
难免孤独
难免孤独 2020-12-23 15:43

I am trying to create a simple alert app for some friends.

Basically i want to be able to extract data \"price\" and \"stock availability\" from a webpage like the f

6条回答
  •  北海茫月
    2020-12-23 16:25

    You are probably best off loading the HTML code into a DOM parser like this one and searching for the "pricing" table. However, any kind of scraping you do can break whenever they change their page layout, and is probably illegal without their consent.

    The best way, though, would be to talk to the people who run the site, and see whether they have alternative, more reliable forms of data delivery (Web services, RSS, or database exports come to mind).

提交回复
热议问题