python - 使用 Python 从 Student Doctor Network (SDN) 收集面试问题
问题描述
我是一个 python 新手,我正在开发一个从学生医生网络(一个流行的医学预科学生论坛)上抓取医学院面试问题。我不确定创建一个随机打印来自任何特定学校的面试问题的程序的最简单方法是什么。
带有问题的示例页面:https ://www.studentdoctor.net/schools/school/emory/survey/26/emory-university-school-of-medicine/1
我不确定 BeautifulSoup 是否是正确的选择,但希望能提供任何帮助或指导,以找到为我的程序提取面试问题的最佳方法。谢谢!
解决方案
您可以使用此示例如何从页面中提取问题:
import requests
from bs4 import BeautifulSoup
url = "https://www.studentdoctor.net/schools/school/emory/survey/26/emory-university-school-of-medicine/1"
soup = BeautifulSoup(requests.get(url).content, "html.parser")
for question in soup.select("h3"):
q = question.get_text(strip=True).replace("\n", " ")
if q.endswith("?"):
print(q)
印刷:
How to tell strength of clinical years?
How did the interview impress you?
What was the stress level of the interview?
How you think you did?
How do you rank this school among ALL other schools?
How long was the interview?
Where did the interview take place?
What was the style of the interview?
What type of interview was it?
How many people interviewed you?
What is one of the specific questions they asked you (question 1)?
What is one of the specific questions they asked you (question 2)?
What is one of the specific questions they asked you (question 3)?
What was the most interesting question?
What was the most difficult question?
How did you prepare for the interview?
What impressed you positively?
What impressed you negatively?
What did you wish you had known ahead of time?
What are your general comments?
Who was the tour given by?
How did the tourguide seem?
How do you rank the facilities?
What is your in-state status?
What was your total time spent traveling?
What was your primary mode of travel?
About how much did you spend on room, food, and travel?
What airport did you use?
Where did you stay?
What is the name of the hotel you stayed in?
Would you recommend the hotel?
How do you rank this school among other schools to which you've applied?
What is your ranking of this school's location?
What is your ranking of this area's cultural life?
How is the responsiveness of the admissions office?
How is the friendliness of the admissions office?
How eco-friendly are the school's application materials and interview process?
What are your suggestions for the admissions office?
推荐阅读
- c++ - C++ 模板参数包自动将 & 添加到其参数
- javascript - JavaScript 未加载到 HTML 文件中
- c# - 无法为外部 dll 加载文件或程序集
- java - 如何将 .wav 文件转换为浮点数组(编辑浮点数组,例如添加两个信号)并返回到没有白噪声的 .wav 文件
- android - com.android.builder.merge.DuplicateRelativeFileException: 发现多个文件与操作系统无关的路径 'META-INF/INDEX.LIST'
- tcl - NS2 代码为什么这不起作用?(模拟程序未运行) 25 个节点
- flutter - 如何在弹出窗口颤动中创建按钮列表
- wpf - 键入 XAML 时如何将插入符号移到结束引号之后?
- css - Media query properties being overwriiten by other breakpoints
- javascript - Javascript 如何删除日元/日元符号