Skip to content

Instantly share code, notes, and snippets.

@luxu
Created April 6, 2022 23:48
Show Gist options
  • Save luxu/333a4edc23795393eeacb19eea9c6a07 to your computer and use it in GitHub Desktop.
Save luxu/333a4edc23795393eeacb19eea9c6a07 to your computer and use it in GitHub Desktop.
import json
from requests import get
from bs4 import BeautifulSoup as bs
url = 'https://mangayabu.top/manga/one-piece/'
html = get(url)
soup = bs(html.content, 'html.parser')
json_data = soup.find('script', type='application/json')
num = json.loads(json_data.text)['allposts'][0]['num']
data = json.loads(json_data.text)['allposts'][0]['date']
print(num, data)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment