Skip to content

Instantly share code, notes, and snippets.

@terakun
Created September 1, 2019 08:59
Show Gist options
  • Save terakun/b3414996acc2bb7e4fe6ba1c8693e805 to your computer and use it in GitHub Desktop.
Save terakun/b3414996acc2bb7e4fe6ba1c8693e805 to your computer and use it in GitHub Desktop.
import requests
from bs4 import BeautifulSoup
print("伝票番号を入力してください")
denpyo_id = input()
response = requests.post('http://toi.kuronekoyamato.co.jp/cgi-bin/tneko', data={'number01':denpyo_id })
soup = BeautifulSoup(response.text, "html.parser")
denpyo_list = soup.find_all('td', class_='denpyo')
hiduke_list = soup.find_all('td', class_='hiduke')
ct_list = soup.find_all('td', class_='ct')
for denpyo,hiduke,ct in zip(denpyo_list,hiduke_list,ct_list):
if denpyo.text == "":
continue
print(denpyo.text+":"+hiduke.text+":"+ct.text)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment