我试图从下载图像 链接= https://mahabhunakasha.mahabhumi.gov.in/bhunaksha/27/index.jsp
我为此使用了beautifulsoup,我得到了所有的html,但是找不到我下载的乡村图片链接。
from bs4 import BeautifulSoup
import ssl
ssl._create_default_https_context = ssl._create_unverified_context#
for dist_name in ['Akola', 'Amravati', 'Buldana', 'yavatmal', 'washim', 'Aurangabad', 'Beed', 'Jalna', 'Osmanabad', 'Latur',
'Nanded', 'Parbhani', 'Hingoli', 'Mumbai City', 'Mumbai Sub-Urban', 'Thane', 'Palghar', 'Raigad', 'Ratnagiri',
'Sindhudurg', 'Bhandara', 'Chandrapur', 'Gadchiroli', 'Gondia', 'Nagpur', 'Wardha', 'Ahmednagar', 'Dhule', 'Jalgaon',
'Nandurbar', 'Nashik', 'Kolhapur', 'Pune', 'Sangli', 'Satara', 'Solapur']:
# print('-- {} --'.format(dist_name))
# r = requests.get('http://igrmaharashtra.gov.in/eASR/eASRCommon.aspx?hDistName={}'.format(dist_name))
r = requests.get("https://mahabhunakasha.mahabhumi.gov.in/bhunaksha/27/index.jsp")
# print(r.url)
for i in r.url:
if r.status_code == 200:
soup = BeautifulSoup(r.text, "html.parser")
select_list = soup.find_all('select')
for select in select_list:
# print('Select name: ' + select.attrs['name'])
option_list = select.find_all('option')
text = [option.text for option in option_list if option.text]
print(text)
编辑: 如果您单击该链接,则将显示提及的网页,因此我想从页面左侧所有提及的区域下载该地图图像。 After u click that image:
编码的链接位于inspect-> source-> js / jquery / js中。 想要下载所有地图图像(.png)并存储在本地。 预先感谢...