0

I have a link to html page - a blog page - and I want to read its content from php laravel code and extract some data fields from there.

The pages would be like this one: https://www.mashvisor.com/blog/san-francisco-real-estate-market-worth-it/

I'm using Laravel 5.0 to do so. How could I extract fields like author and titles?

  • 4
    This is a very broad question, I think you should do some more initial research. – misorude Jul 22 '19 at 10:35
  • I would indeed start looking more into DOM crawlers. Laravel will not help you with this. I have personally used tools like the symfony dom crawler for this. Good luck. – Ghlen Jul 22 '19 at 11:08
  • 1
    You could start taking a look here https://stackoverflow.com/questions/9813273/web-scraping-in-php or even better here https://stackoverflow.com/questions/584826/scrape-web-page-contents – Ing. Luca Stucchi Jul 22 '19 at 11:28

1 Answers1

1

Since the site you are wanting to get data from is Wordpress just use the available api. It provides the data you're looking for in json format.

https://www.mashvisor.com/blog/wp-json/wp/v2/posts

Mark
  • 1,255
  • 1
  • 13
  • 25