-
Notifications
You must be signed in to change notification settings - Fork 231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
About artists.py #4
Comments
|
理解了你的意思,但数据库里面什么也没有。 |
爬去的soup里面的内容呢直接浏览的内容不一样,如http://music.163.com/#/discover/artist/cat?id=2002&initial=68 。直接在这个页面上面如 “周杰伦”右键检查可以看到tag属性,“<a href=" /artist?id=6452" class="nm nm-icn f-thide s-fc0" 是不是被网易禁止了? |
@Zhang21 是不是frame的问题,右键检查”周杰伦“属性会发现,他在源码html的iframe层里面,需要用selenium的 driver.switch_to.frame(driver.find_element_by_xpath("//iframe"))才行,之后再用bs解析就行了 |
这个xpath定位不到是因为有大量的js渲染吗?bs可以获取能理解为bs可以解析渲染/动态网页吗? |
有一个问题,亲!在artists.py中:
params = {'id':group_id, 'initial':initial},这两个参数是做什么的?
还有你的headers定义了为什么没有在requests当中使用?
我的body有问题,导致后面的hot_artists和artist都是空值。
我换了好几个requests(url)中的URL,结果返回的soup还是有问题。应该还是上面两个params我没理解到是什么意思而导致后面错误。
这个连接本地或者远程MySQL是要提前把sql.py中的表先建好吗?
The text was updated successfully, but these errors were encountered: