Add docs on how to access HTML elements from PyScript
See original GitHub issueOriginal question: Trying to move some of the JavaScripts to pyscript, its there a way to of something like this in pyscript now?
var metas = document.getElementsByTagName('meta');
There is! There are some examples in this very issue. Adding docs for it would be very easy =) I think it probably fits under the “How to” or the “Reference session”, maybe? Depending on how the person who chooses to tackle this one decides to go about it. Probably easier to add it on the “how to” though because I think @tedpatrick has specific ideas on how the reference should go.
In case you need help for this, please let me know! We have docs on how to contribute to the docs, but maybe they’re not so clear. Thank you!
Issue Analytics
- State:
- Created a year ago
- Reactions:5
- Comments:12 (2 by maintainers)
Top Results From Across the Web
From pyscript, how can I access the file that I load from html?
And this is the block of code from which I try to access the file but it doesn't work for me. fasta_1 =...
Read more >Getting started with PyScript
In this document, we'll use the PyScript assets served on https://pyscript.net. ... Let's create a new file called index.html and add the following...
Read more >PyScript — HTML and Python in Browser | 2022 Tutorial
Importing Python Script from file; Output Python code to HTML Tags ... the libraries from PyScript.net and add them to your project or...
Read more >Intro to PyScript: Run Python in the browser
Accessing and manipulating HTML elements using PyScript ... Next, create a settings.json file and add the following contents: { "editor.
Read more >PyScript - Python Application in HTML
You can start using PyScript in HTML just by adding the following two lines between the ... We also use py-env to import...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
document.querySelector
seems to be a thing already!https://github.com/pyscript/pyscript/blob/6943304d6b763320a7a7cf0e7f5d1f60a18ca7fe/pyscriptjs/src/pyscript.py#L106from js import document, DOMParser, setInterval
saw this line in an example so there seems to be a thing, but would have to dig deeper into code. you can maybe get html from document and use a python DOM parser lib. which maybe a weird way to go about it. uncharted territory, much fun!