简体   繁体   中英

PHP + cURL - Scraping data from a website with user profile using REACT

我想从codecademy的div上抓取数据,我已经整理了登录名,但是数据是通过react.js加载的,所以我无法使用simple_html_dom来获取所需的信息。

It probably won't be that easy. Pages rendered using React, or any other javascript intensive framework, only load the majority of the content through javascript. This means that initially only a stub site gets loaded into the DOM. Then javascript kicks in and adds new nodes to the DOM. If you want to scrape content from such websites you need to simulate a browser. You could use PhantomJS for this. It is a headless browser implementation in javascript. I'm not aware of any headless browsers for PHP.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM