โมดูล webbrowser ใน Python ให้ฟังก์ชันสำหรับเปิด URL ในเบราว์เซอร์เริ่มต้นของระบบ ไม่ต้องติดตั้งเพิ่มเติม (built-in module)
การใช้งานพื้นฐาน
import webbrowser
url = 'https://www.tutorialspoint.com/'
webbrowser.open_new_tab(url) # เปิดในแท็บใหม่
# webbrowser.open(url) # เปิดในหน้าต่างใหม่
ตัวอย่างโค้ด
import webbrowser
url = 'https://www.tutorialspoint.com/'
webbrowser.open_new_tab(url)
ผลลัพธ์
เบราว์เซอร์เริ่มต้นจะเปิดและโหลด URL ที่ระบุ

หมายเหตุ: โมดูล webbrowser เป็น built-in module ไม่ต้องติดตั้งด้วย pip