# coding=utf-8
import requests
from bs4 import BeautifulSoup

# 获取html文档
def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text

# 获取笑话
def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')

    # for i in len(soup.select('div.content')):
    #     print(soup.select('div.content')[i].get_text())

    joke_content = soup.select('div.content')[0].get_text()

    return joke_content

url_joke = "https://www.qiushibaike.com"
html = get_html(url_joke)
joke_content = get_certain_joke(html)
print(joke_content)
acf4f3cea823f56f88eef288cdf953b0b80a9599
<mask token>


def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text


def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')
    joke_content = soup.select('div.content')[0].get_text()
    return joke_content


<mask token>

<mask token>


def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text


def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')
    joke_content = soup.select('div.content')[0].get_text()
    return joke_content


<mask token>
print(joke_content)

<mask token>


def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text


def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')
    joke_content = soup.select('div.content')[0].get_text()
    return joke_content


url_joke = 'https://www.qiushibaike.com'
html = get_html(url_joke)
joke_content = get_certain_joke(html)
print(joke_content)

import requests
from bs4 import BeautifulSoup


def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text


def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')
    joke_content = soup.select('div.content')[0].get_text()
    return joke_content


url_joke = 'https://www.qiushibaike.com'
html = get_html(url_joke)
joke_content = get_certain_joke(html)
print(joke_content)

# coding=utf-8
import requests
from bs4 import BeautifulSoup

# 获取html文档
def get_html(url):
    """get the content of the url"""
    response = requests.get(url)
    response.encoding = 'utf-8'
    return response.text

# 获取笑话
def get_certain_joke(html):
    """get the joke of the html"""
    soup = BeautifulSoup(html, 'lxml')

    # for i in len(soup.select('div.content')):
    #     print(soup.select('div.content')[i].get_text())

    joke_content = soup.select('div.content')[0].get_text()

    return joke_content

url_joke = "https://www.qiushibaike.com"
html = get_html(url_joke)
joke_content = get_certain_joke(html)
print(joke_content)