appapple
  • 1
  • 新人请关照

使用Selenium和Requests获取的源码,与浏览器开发者模式中Elements里的不一致

目标网址:

https://store.dji.com/cn/cate...

目标图片:

product2.djicdn.com/uploads/spu/covers/31220/small_3888877d-fc35-4e0e-b266-e7756e237150%402x.png

想获得的解决办法:

我想获取和Chrome开发者模式(F12)中一模一样的源码(因为,用正则匹配后,发现无法与产品名称相匹配)
请帮帮我,谢谢!

Chrome开发者模式,源码里的图片位置(我想获得的源码):

<div class="style__cover___19vV4"><img src="
//product2.djicdn.com/uploads/spu/covers/31220/small_3888877d-fc35-4e0e-b266-e7756e237150%402x.png"></div>

使用Selenium或者Requests返回的都是这样的代码(不想得到的):

"cover":{"small":"u002Fu002Fproduct3.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002Fsmall_3888877d-fc35-4e0e-b266-e7756e237150.png","thumb_374":"u002Fu002Fproduct4.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002F3888877d-fc35-4e0e-b266-e7756e237150%40374.jpg",

>图片在这里,好像是被储存到一个字典里<

"retinaSmall":"u002Fu002Fproduct2.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002Fsmall_3888877d-fc35-4e0e-b266-e7756e237150%402x.png",

"original":"u002Fu002Fproduct4.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002F3888877d-fc35-4e0e-b266-e7756e237150.png","mini":"u002Fu002Fproduct3.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002Fmini_3888877d-fc35-4e0e-b266-e7756e237150.png","thumb_290":"u002Fu002Fproduct2.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002F3888877d-fc35-4e0e-b266-e7756e237150%40290.jpg","

>图片在这里,好像是被储存到一个字典里<

retinaMini":"u002Fu002Fproduct2.djicdn.comu002Fuploadsu002Fspuu002Fcoversu002F31220u002Fmini_3888877d-fc35-4e0e-b266-e7756e237150%402x.png",

阅读 519
评论 2019-05-25 提问
    撰写回答

    登录后参与交流、获取后续更新提醒