开发者

webcontent save in csv format

I want to read the content from website and save then into a csv file in php, can anyone please tell me h开发者_如何学Cow I can do this.


How do you want to save a website's content as csv file? CSV means comma separated values, and it's really easy to save things as csv file but a website's content?

You say "the content from a website" - normally you'll start reading one sites content, which includes html markup, scripts and styles. Or do you only want to get the text contents or some meta data?

If your server supports opening urls via fopen I'd try this one (php.ini option: allow_url_fopen) - otherwise you'll have to use cURL or something.

Here's some more information about reading websites in php. Regarding the storage of websites as csv I think you should be more precise what you want to achieve.

Regards, Daniel


There's no instant-magic answer for your question. We (You) need to know which website is in question, how the table is presented. If you know everything about your scenario, you should use PHP's DOM functions and parse your table then export it to a CSV.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜