简体   繁体   中英

python webbrowser.open cannot open long url

I tried to use webbrowser.open() function to open a long url in python, but it seems it cannot open a long url correctly. The string passed to this function is truncated to about 2083 bytes long and only the front part is opened. The code is sth like this

import webbrowser
url = 'www.google.com/parametersssssssssss....' #very very long
webrowser.open(url) #only front part is opened

No exception is tracked. Anyone has similar situation about it?

Since webbrowser it is just iterface to allow displaying web-based documents it is not handling urls by himself. There is just transferring of urls into installed browsers.

Good description of max length of URL in different browsers .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM