Skip to content
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

请点击new issue发帖提问 #35

Closed
chengjun opened this issue May 24, 2016 · 5 comments
Closed

请点击new issue发帖提问 #35

chengjun opened this issue May 24, 2016 · 5 comments

Comments

@chengjun
Copy link
Member

chengjun commented May 24, 2016

使用这个方法,可以便于大家查询问题。

  • 提问之前先搜索
  • 软件提示出错要给出代码和出错提示两部分内容。

常见问题和解答见:

http://nbviewer.jupyter.org/github/computational-class/cjc2016/blob/gh-pages/slides/0.common_questions.slides.html#/

这里可以贴代码

for i in range(10):
    print i
@Oranni
Copy link

Oranni commented May 25, 2016

老师好我这边的问题是:
http://mp.weixin.qq.com/profile?src=3&timestamp=1464169161&ver=1&signature=ZdyhV0hBgvQjTwQwq5-6NK5hujUCFRYP3lZ2MRKVslHN8DuffzOIfhWgD5sMEqcPDGSnJoGOCkBvlbOwIWwvCQ==
这个网页里面的很多class我都找不到。我用find_all列出所有class发现里面的很多class也就是一个一个的文章的上一级title都扒不出来。然后就没有办法抓取每个文章class里面的URL。
希望老师解答一下~~3Q

对哒,老师尽快解答哈~~要交作业。。3Q老师!!!~XDDD

@chengjun
Copy link
Member Author

@Oranni 举一个栗子🌰,记得给出代码

@Oranni
Copy link

Oranni commented May 25, 2016

import urllib2 from bs4 import BeautifulSoup
url = 'http://mp.weixin.qq.com/profile?src=3&timestamp=1464169161&ver=1&signature=ZdyhV0hBgvQjTwQwq5-6NK5hujUCFRYP3lZ2MRKVslHN8DuffzOIfhWgD5sMEqcPDGSnJoGOCkBvlbOwIWwvCQ==' content = urllib2.urlopen(url).read() soup = BeautifulSoup(content, 'html.parser')
print soup.div
brief_info=soup.find_all('div',{'class','profile_desc_value'})——显示[]空的列表

@chengjun
Copy link
Member Author

testWechat.ipynb.zip

@Oranni 我打印出来有东西,见附件。

@Oranni
Copy link

Oranni commented May 25, 2016

收到,我没有逐一打印,我再看看怎么扒文章的list ,非常谢谢老师~

祝好,
刘妮

在 2016年5月25日,下午9:59,Wang Cheng-Jun notifications@github.com 写道:

testWechat.ipynb.zip https://github.com/computational-class/cjc2016/files/282112/testWechat.ipynb.zip
@Oranni https://github.com/Oranni 我打印出来有东西,见附件。


You are receiving this because you were mentioned.
Reply to this email directly or view it on GitHub #35 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants