python - __scraping__ 网站时找不到服务器端值
问题描述
您好,我想抓取一个天气网站https://www.theweathernetwork.com/。我编写下面的代码来获取实时天气,但在我的代码中没有得到任何价值。
输入
from bs4 import BeautifulSoup
import requests
html_page = requests.get("https://www.theweathernetwork.com/bd/weather/dhaka/dhaka")
soup = BeautifulSoup(html_page.content, 'lxml')
content=soup.find(class_='wx-content current-obs')
temp=content.find('span', class_='temp')
temp
输出
[<span>°</span>]
解决方案
推荐阅读
- javafx - JavaFX-Apache pdfbox 在窗格中查看 PDDocument
- php - 来自 ajax 页面的值仅在 jquery 的第二次尝试中获得
- three.js - THREE.js 根据 mp3 中的数据改变平面的顶点
- kubernetes - 如何使用组类型查看主题成员
- elasticsearch - logstash cron 计划从特定时间开始每 12 小时运行一次
- corda - Corda 信用证演示不工作
- python - 比循环和调用循环和调用另一个函数的函数更好的方法
- c - 打印传递给 pthread_create 的参数
- c# - 缺少字段的 CsvHelper 列表
- angular6 - 我们如何在上下文菜单操作中增加 ag-grid 数据的大小?