http://code.cside.com/3rdpage/us/windows/windows-1258.html这里能够看到所有编码.
import requests
from bs4 import BeautifulSoup
url = "
http://code.cside.com/3rdpage/us/windows/windows-1258.html"
response = requests.request(method='get', url=url)
html_doc = response.text
soup = BeautifulSoup(html_doc, 'html.parser')
for input in soup.find_all('input', class_='ix'):
with open("label_viet.txt", "a") as f:
f.writelines(input.get('value')+"\n")