http://tatehide.com/nsw1.html

---------------------------------------------------------------

Xg2-3-1

import requests
from bs4 import BeautifulSoup

res = requests.get('http://tatehide.com/nsw1.html')
res.encoding = res.apparent_encoding

sp = BeautifulSoup(res.text, 'html.parser')
print(sp)

---------------------------------------------------------------

Xg2-3-2

import requests
from bs4 import BeautifulSoup

res = requests.get('http://tatehide.com/nsw1.html')
res.encoding = res.apparent_encoding

sp = BeautifulSoup(res.text, 'html.parser')
print(sp.select_one('#date').string)

---------------------------------------------------------------

Xg2-3-3

import requests
from bs4 import BeautifulSoup

res = requests.get('http://tatehide.com/nsw1.html')
res.encoding = res.apparent_encoding

sp = BeautifulSoup(res.text, 'html.parser')
selector = '#wrapper > table > tbody > tr:nth-child(2) > td:nth-child(4)'
print(sp.select_one(selector).string)

---------------------------------------------------------------

Xg2-3-4

import requests
from bs4 import BeautifulSoup

res = requests.get('http://tatehide.com/nsw1.html')
res.encoding = res.apparent_encoding

sp = BeautifulSoup(res.text, 'html.parser')
elms = sp.select('.item')

for elm in elms:
    print(elm.string)

---------------------------------------------------------------

Xg2-3-5

import requests
import bs4

res = requests.get('http://tatehide.com/nsw1.html')
res.encoding = res.apparent_encoding

sp = bs4.BeautifulSoup(res.text, 'html.parser')
item = sp.select('.item')[0]

for elm in item.next_siblings:
    print(elm.string)

---------------------------------------------------------------
