Selenium爬虫遇到数据是以JSON字符串的形式包裹在Script标签中,假设Script标签下代码如下:<scriptid="DATA_INFO"type="application/json">{"user":{"isLogin":true,"userInfo":{"id":123456,"nickname":"LiMing","intro":"人生苦短,我用python"}}}</script>此时drive.find_elements_by_xpath('//*[@id="DATA_INFO"]只能定位到元素,但是无法通过.text方法,获取Script标签下...
继续阅读 >