擅长:python、mysql、java
<pre><code>r = requests.get("https://www.econometricsociety.org/publications/econometrica/2017/03/01/search-yield")
soup = BeautifulSoup(r.text,'lxml') # I prefer using xml parser
find_article = soup.find('article')
# Next line how to find The title in this case: Econometrica: Mar 2017, Volume 85, Issue 2
find_title = find_article.h3
# find search yeild
find_yeild = find_article.h1
#first_paragraph example : DOI: 10.3982/ECTA14057 p. 351-378
find_1para = find_article.p
#second p example : David Martinez‐Miera, Rafael Repullo
find_2para = find_article.p.find_next_sibling("p")
#find the large text area using e.g. 'We present a model of the relationship bet...'
find_largetxt = find_article.p.find_next_sibling("p").nextSibling
</code></pre>
<p>我使用了各种方法来访问你想要的文本区域,仅仅是为了教育目的(你可以使用.text来获得没有标签的文本,或者你可以使用Zroq的方法)。
但是,您可以通过以下方式将其中的每一个写入到文件中,例如</p>
^{pr2}$