Hello people,
Do someone know how to get online data from website and insert it into GH?
Thanks to all for help =))
Hello people,
Do someone know how to get online data from website and insert it into GH?
Thanks to all for help =))
You probably need to specify this a bit further. But assuming you just need to read some raw text for instance, you can use the standard urllib
module:
Sorry, can I download somewhere this standard urllib module?
It’s part of the standard Python library, so you don’t need to download it. Try running the file I posted above and change the URL variable to whatever website you’re trying to read, see what you get.
Swiftlet is for interacting with Web API’s and scrapping.
Available on the package mananger as well
Sorry for additional question, where can I get this code, this is what I found on Python library?
Did you check out the file I posted above? You simply import urllib
in your script
Yep, sorry
Probably, what’s the URL?
This or this is what you need. maybe somebody with some Python knowledge can adapt this to work with Grasshopper.
I just need to extract online parameters from websites no more no less
Do you have a sample of how to read it using swiftlet?
Swiftlet is well documented and comes with a number of examples.
Unfortunately it is not working anymore if I do make a modification to the gist file. It is displaying only the old content but not the actualized one.
There appears to be a GitHub issue where the raw representation of the source file is not immediately updated (took a few minutes on my test just now). Anywho, the code still works. So maybe just host your data elsewhere and read it from there, if that lag is a concern.
How you are getting the RAW URL (https://raw.githubusercontent.com/AndersDeleuran/ahd/main/ahd.py)?
I do get only a URL like this:
https://gist.github.com/username/94fa000f2671400211a9bd330163c32b