If you run the script below, you will not get a response.
import mechanismize
b=mechanize.Browser();
b.set_handle_robots (False);
h=b.open('http://stocks.finance.yahoo.co.jp/stocks/detail/?code=2726');
Other url (such as http://www.google.com
) will respond properly.
Why?
This is stock price information, so I think it is caused by regular refresh.
Specify set_handle_refresh(False)
to disable the Refresh header.
Verified a response.
import mechanismize
b=mechanize.Browser()
b. set_handle_robots (False)
b. set_handle_refresh (False)
h=b.open('http://stocks.finance.yahoo.co.jp/stocks/detail/?code=2726')
In detail, python does not require ;
.
Even if there is one, it doesn't make an error...
610 GDB gets version error when attempting to debug with the Presense SDK (IDE)
912 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
578 Understanding How to Configure Google API Key
617 Uncaught (inpromise) Error on Electron: An object could not be cloned
© 2024 OneMinuteCode. All rights reserved.