How to make file/result downloadable in html - javascript

I will request you see this repo: https://github.com/imsikka/ArtGallery
I want to make the result downloadable using a download button, I know how to make a download button but I don't know how it will make the file downloadable, I need to link the button with a specific part code or what?
Well I really don't know how to do it i surfed the net but got nothin really helpful

You can upload the information you want to download on an uploader site and apply the download link to the button using
Maybe this way you can solve your problem
Info: Conclusion. In HTML, a button link to another page can be by using the tag, tag, and the tag. A link on a button is get by href=”” attribute of tag. The “type=button” and “onclick=link” attributes are used to create a link on the button.

Related

Wordpress HTML custom tag not working when I click "post"

I'm trying to add some custom html code to a Wordpress post in order to be able to add a small javascript "program" that let's you change a square's color depending on a value you enter.
The code is html with style and script tags. It works correctly when tested on my computer and when I click the "Preview" button on the HTML custom tag. However, once I post the post it breaks and shows the entire code as text. Is there a way I can make it work? I've been watching videos and reading about how to fix this, but I can't find a solution!
Thank you for your time!!

Download a file using python from a webpage without opening the webpage

I was looking for a way to write a script that will download a file from a specific website but without opening the website itself. I want everything to happen in the background.
The website is morningstar and a specific link for the example is this one:
https://financials.morningstar.com/ratios/r.html?t=MSFT
in this page, there is a "Button" (it is not really declared as a button but as a Hyperlink, the <a> tag in HTML)
I added a photo in the bottom so you can see for yourself exactly the way they wrote the code.
Anyway, I saw that when I clicked the button the href attribute actually calls a javascript function which then creates the links from which the file will be downloaded.
I am looking for a way that I can write a script and give it the link I want, for example, the link above, and the script will download this specific CSV file from that page into a folder of my choice.
I was looking at some selenium tutorials but I couldn't find much help for my specific problem.
Here's an example I use:
import requests
url = 'http://via.placeholder.com/350x150'
dashboardFile = requests.get(url, allow_redirects=True)
open('d:/dev/projects/new-wave/dashboard.pdf', 'wb').write(dashboardFile .content)
Oh, and depending on the size of the file you would want to download in chunks. A quick search of: "python download large file in chunks" will help.

Selenium: Getting ultimate href/link without clicking on it when it's a javascript call

I am webscraping a long table of html links (allowed under ToS). However, all the links are javascript calls (href="javascript:;") so using get_attribute() to get the link will not work. I don't want to actually click on all the links since it will download a large pdf file for each one
Is it possible to get the ultimate href/link that is called, without actually clicking the link and downloading the file?
Thank you!
Yes, but not easy - you need to take a look at javascript beyond those links, probably the links are generated dynamically.
The idea of doing this is described here
What does href expression do?
In short: in HTML for <a> to render correctly you need to set href, but sometimes there is no direct link or it's calculated somehow - so you need to look at javascript code which performs handling of those links - probably it's some click event listener you need to find

embedding a page with some javascript on a tumblr post

I want to reproduce a simple, one page website with some javascript in a tumblr post (as a form of documentation for a project) but everytime I try to put the source html of the site into the tumblr form it ends up not loading at all inside the tumblr... Here's the page I'm trying to "embed" into tumblr: www.benenson.ae/recording.html
When I copy the html into the tumblr console, I'm fixing the path to the scripts at the top so that's not the problem..Am I missing some trick for getting this to work inside Tumblr?
I wasn't sure what support there was for iframes in tumblr, but it is possible, but you will need to add some styling to suit your needs:
I simply created a new post, selected the html tab and then put in the following code:
<iframe src="http://www.benenson.ae/recording.html"></iframe>
Alternatively you could create a single post, uploading the image content to tumblr and make it link to anywhere you like, and then add a caption for the post that replicates the current text you have.
If that helps or you want to pursue the second option, let me know and I can update my answer.

how can i Grab Source code & save it in text file

I need your help to grab the source code of the page & can save it in a text file.
What actually i want!!
Instead of doing the lot of work like, right click on the page then click on view source code then to copy & paste it in a text file...
I want to make a short, i want to put a link on the page, in which i need to grab a source code, so when i just click on that link let say "Download Code" it grabs the current page source code & save it in a .txt format.
Kindly help me how can i do this?? it would be great if i can achieve this by using a java script, i don't want to use server side programming language.
I tried data URI but dont get the exact what i need
I find some thing on the below link:
http://css-tricks.com/examples/ViewSourceButton/#

Categories