{eyou:navigation position_id='4' id='nav'}
{$nav.nav_name}
{/eyou:navigation}
pythonCopy code
import requests
from bs4 import BeautifulSoup
url = 'https://www.baidu.com/'
response = requests.get(url)
html = response.text
soup = BeautifulSoup(html, 'html.parser')
search_input = soup.find('input', {'id': 'kw'})
search_button = soup.find('input', {'id': 'su'})
print(search_input)
print(search_button)