2017-06-13 28 views
-3

如何提取两个<h2>标头之间的<a>号码与class="xref-bibr"Python 2个标题之间提取标签类别信息<a>

<h2 class="">1. Introduction</h2><p id="p-3">The colonization of the remote islands of East Polynesia from the AD eleventh to thirteenth centuries was the last major migration of modern humans to habitable lands [<a id="xref-ref-1-1" class="xref-bibr" href="#ref-1">1</a>,<a id="xref-ref-2-1" class="xref-bibr" href="#ref-2">2</a>]. During this dispersal, voyagers transported a variety of cultigens and commensal species throughout the East Polynesian archipelagos, including taro (<em>Colocasia esculenta</em>), bottle gourd (<em>Lagenaria siceraria</em>), paper mulberry (<em>Broussonetia papyrifera</em>), Pacific rat (<em>Rattus exulans</em>), pig (<em>Sus scrofa</em>) and chicken (<em>Gallus gallus domesticus</em>) [<a id="xref-ref-3-1" class="xref-bibr" href="#ref-3">3</a>–<a id="xref-ref-7-1" class="xref-bibr" href="#ref-7">7</a>]. Previous studies have demonstrated how the analysis of the distribution, morphology, genetics and age of these translocated species can provide important insights into the timing and origins of prehistoric movements of people throughout the Pacific (e.g. [<a id="xref-ref-1-2" class="xref-bibr" href="#ref-1">1</a>,<a id="xref-ref-8-1" class="xref-bibr" href="#ref-8">8</a>–<a id="xref-ref-15-1" class="xref-bibr" href="#ref-15">15</a>]). Prehistoric bones indicate that some commensal species, such as the Pacific rat, were nearly ubiquitous throughout East Polynesia [<a id="xref-ref-8-2" class="xref-bibr" href="#ref-8">8</a>,<a id="xref-ref-9-1" class="xref-bibr" href="#ref-9">9</a>]. However, the distribution of other species remains poorly resolved [<a id="xref-ref-3-2" class="xref-bibr" href="#ref-3">3</a>,<a id="xref-ref-6-1" class="xref-bibr" href="#ref-6">6</a>]. For example, prehistoric chicken bones have been excavated from early Polynesian middens on some of the most remote islands in the region, including Rapa Nui/Easter Island and Hawai'i [<a id="xref-ref-14-1" class="xref-bibr" href="#ref-14">14</a>], yet they remain conspicuously absent from the equally remote but cooler subtropic and temperate southern islands of Polynesia (including New Zealand, and the Chatham, Auckland, Kermadec and Norfolk Islands) [<a id="xref-ref-3-3" class="xref-bibr" href="#ref-3">3</a>,<a id="xref-ref-6-2" class="xref-bibr" href="#ref-6">6</a>]. The apparent absence of prehistoric chicken remains on these islands raises many questions [<a id="xref-ref-3-4" class="xref-bibr" href="#ref-3">3</a>]. For example, were chickens introduced by the first Polynesian settlers but then subsequently lost to disease, low propagule pressure, competition and predation or because there was no need to sustain domestic chickens in the presence of abundant large native flightless birds? Were they never taken in the first place [<a id="xref-ref-16-1" class="xref-bibr" href="#ref-16">16</a>–<a id="xref-ref-19-1" class="xref-bibr" href="#ref-19">19</a>]? Or, have chicken bones in prehistoric middens been overlooked as recent contamination? Answering these questions will help to resolve broader questions regarding the frequency and longevity of inter-island voyaging following initial settlement. This is of particular relevance on Pacific islands, where large prey species were hunted to extinction relatively quickly and human population growth meant food resources soon became limited. In such scenarios, returning to ancestral islands to source chickens (or other food resources) would clearly be desirable if long-distance inter-island travel was still feasible. For example, in Tonga, radiocarbon dating suggests that chickens were only introduced after the large native megapode (<em>Megapodius alimentum</em>) and iguana (<em>Brachylophus</em> sp.) had become extinct [<a id="xref-ref-3-5" class="xref-bibr" href="#ref-3">3</a>].</p><p id="p-4">In the light of these long-debated and unresolved questions, it is perhaps surprising that the prehistoric presence of chickens in New Zealand has never been critically examined, especially given that the lack of evidence for their former absence is somewhat misleading. In fact, chicken bones have been excavated from several localities of prehistoric Polynesian (Māori) middens throughout New Zealand, including potentially archaic sites (e.g. [<a id="xref-ref-20-1" class="xref-bibr" href="#ref-20">20</a>–<a id="xref-ref-26-1" class="xref-bibr" href="#ref-26">26</a>]). Chicken bones in Māori middens are usually assumed to represent disturbance and incorporation of recent material into older layers (e.g. [<a id="xref-ref-26-2" class="xref-bibr" href="#ref-26">26</a>]). In some sites, this is likely, especially where stratigraphy is disturbed, and/or where other items, such as sheep (<em>Ovis aries</em>) bones or glass, are also present (e.g. [<a id="xref-ref-23-1" class="xref-bibr" href="#ref-23">23</a>,<a id="xref-ref-24-1" class="xref-bibr" href="#ref-24">24</a>]). However, such dogma creates the potential for genuine prehistoric chicken remains to be overlooked.</p><p id="p-5">Here, we provide the first radiocarbon and ancient DNA analyses of chicken bones from sites of Māori middens containing prehistoric material. We focus on bones from three different sites along the northeast coast of New Zealand's South Island (<a id="xref-fig-1-1" class="xref-fig" href="#F1">figure 1</a>). The sites were selected as ideal candidates for finding potentially prehistoric chicken specimens, as they also contained pre-European faunal assemblages (electronic supplementary material), including bones of moa and other large birds (such as South Island adzebill (<em>Aptornis defossor</em>) and South Island goose (<em>Cnemiornis calcitrans</em>)) that became extinct within 200 years of initial human settlement [<a id="xref-ref-27-1" class="xref-bibr" href="#ref-27">27</a>–<a id="xref-ref-29-1" class="xref-bibr" href="#ref-29">29</a>]. 
</p><div id="F1" class="fig pos-float odd"><div class="highwire-figure"><div class="fig-inline-img-wrapper"><div class="fig-inline-img"><a href="http://rsos.royalsocietypublishing.org/content/royopensci/3/8/160258/F1.large.jpg?width=800&amp;height=600&amp;carousel=1" title="Locations (squares) and number of live chickens liberated or gifted to M&#x101;ori tribes on Captain Cook's second voyage to New Zealand in 1773 (male red, female blue). The locations of the three chicken bones from M&#x101;ori middens examined in this study are marked by circles." class="highwire-fragment fragment-images colorbox-load" rel="gallery-fragment-images-1723777227" data-figure-caption="&lt;div class=&quot;highwire-markup&quot;&gt;Locations (squares) and number of live chickens liberated or gifted to M&#x101;ori tribes on Captain Cook's second voyage to New Zealand in 1773 (male red, female blue). The locations of the three chicken bones from M&#x101;ori middens examined in this study are marked by circles.&lt;/div&gt;" data-icon-position="" data-hide-link-title="0"><span class="hw-responsive-img"><img class="highwire-fragment fragment-image lazyload" alt="Figure 1." src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-src="http://rsos.royalsocietypublishing.org/content/royopensci/3/8/160258/F1.medium.gif" width="440" height="387"/><noscript><img class="highwire-fragment fragment-image" alt="Figure 1." src="http://rsos.royalsocietypublishing.org/content/royopensci/3/8/160258/F1.medium.gif" width="440" height="387"/></noscript></span></a></div></div><ul class="highwire-figure-links inline"><li class="download-fig first"><a href="http://rsos.royalsocietypublishing.org/content/royopensci/3/8/160258/F1.large.jpg?download=true" class="highwire-figure-link highwire-figure-link-download" title="Download Figure 1." data-icon-position="" data-hide-link-title="0">Download figure</a></li><li class="new-tab"><a href="http://rsos.royalsocietypublishing.org/content/royopensci/3/8/160258/F1.large.jpg" class="highwire-figure-link highwire-figure-link-newtab" target="_blank" data-icon-position="" data-hide-link-title="0">Open in new tab</a></li><li class="download-ppt last"><a href="/highwire/powerpoint/6850" class="highwire-figure-link highwire-figure-link-ppt" data-icon-position="" data-hide-link-title="0">Download powerpoint</a></li></ul></div><div class="fig-caption" xmlns:xhtml="http://www.w3.org/1999/xhtml"><span class="fig-label">Figure 1.</span> <p id="p-6" class="first-child">Locations (squares) and number of live chickens liberated or gifted to Māori tribes on Captain Cook's second voyage to New Zealand in 1773 (male red, female blue). The locations of the three chicken bones from Māori middens examined in this study are marked by circles.</p><div class="sb-div caption-clear"></div></div></div></div><div class="section" id="sec-2"><h2 class="">2. Results</h2> 
+0

请修改您的帖子,使其看起来不像垃圾邮件。 –

+1

查看文档并找到帮助您解决问题的方法,然后实施解决方案。 https://www.crummy.com/software/BeautifulSoup/bs4/doc/#find-all – wwii

+0

可能的重复https://stackoverflow.com/questions/5041008/how-to-find-elements-by-class –

回答

0

的findAll函数的第一个参数要求的标签,并与第二个参数,你可以指定任何属性。

html = """your text here""" 
bs = bs4.BeautifulSoup(html) 
a_count = len(bs.findAll("a", {"class":"xref-bibr"})) #returns 25 
+0

我做了同样的,但我原来的HTML包含70“类”:“xref-bibr”,但我只想提取这两个标题之间。 –

+0

没有关于html布局的更多信息没有保证,您可以搜索标签(.find()),每个标签(.findAll())的第一次出现,或者考虑到特定路径(汤.tag.tag.ect)-https://www.crummy.com/software/BeautifulSoup/bs4/doc/ – Tony