问题美丽汤

时间:2018-12-10 20:10:53

标签: python beautifulsoup

我正在尝试从下面提取Git存储库的url,但是从Python访问它确实有困难。

toString()

https://coinmarketcap.com/currencies/united-bitcoin/historical-data/?start=20080428&end=20181211 enter image description here

当我访问网站,源代码和技术文档研究链接时,就会得到大量的url。

1 个答案:

答案 0 :(得分:1)

对于您提供的数据,以下内容似乎对我有用:

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
   <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
</head>
<body>
<div id="mydiv">
This is some number +387(0)61 833-312. Here is one more number +385 (95) 837 312 . <p> One more number here +385(95) 835-312</p> <p>One more number 061/665-151</p>One more phone: 061-353-654</p>
</div>
</body>
</html>

如果您不希望使用星号,

url = soup.find('a')['href']