import urllib2
from bs4 import BeautifulSoup
# specify the url
rng_page = ‘https://www.random.org/strings/'
# query the website and return the html to the variable ‘page’
page = urllib2.urlopen(rng_page)
# parse the html using beautiful soup and store in variable `soup`
soup = BeautifulSoup(page, ‘html.parser’)
....
当然,你可以从提供随机噪音的网站上得到
https://www.random.org/strings/
随机性来自大气噪声,在许多方面比计算机程序中常用的伪随机数算法好
使用BeautifulSoup来删除页面
相关问题 更多 >
编程相关推荐