How to get the download link hidden behind a radio button? - html

I'm trying to download a csv file from this link. I know from this thread that we need to use the requests library to get the link by first submitting the form, in this case, to let the server know we want the csv file. However, since I'm not familiar with html and the previous example has now an updated page, I wasn't able to figure out how to do this, i.e., what formdata to submit and how to post the form and get the link...Any help is appreciated.

Related

Prefilled a form and get URL

I am trying to prefill a website form and get the URL. I was able to find the varaible name using Chrome developer tool. For example, the one in the image is "app_email". However, when I change the URL accoridng to the instructions and reopen with the new URL, the form is not prefilled. Is there any suggestions? Thanks
I tried to edit the URL as stated above

HTTP request body to click a button and extract url in SSIS

I'm trying to get the link of csv file automatically using a get http request. I'm not sure what code I have to post to receive the link for the file. The following is the code for the button.
<div class="export-button-wrapper">
<button id="download-city-opp-btn" class="ui secondary button download-opp-btn" onclick="return downloadBidOpportunities('city');" data-segment-category="export data" data-segment-label="export by zip">Export by City</button>
</div>
The way this export process works is on clicking the export by city button it loads for sometime and then creates a hyperlink to the right of the button as seen in the image. I am trying to create a series of http requests to automatically capture the link for the csv file. Any help on this would great! Thanks
If you do right click on the button and there is no direct link to the file it means that the URL is generated at each download.
There is no way to do this through SSIS.
Therefore you need to create a web crawler in C#, Python, PowerShell or whatever to actually click on that button and catch the file.
You can then run that script through SSIS.

How does one hide the URL for a link to a file?

I've got a C#, Kendo MVC, Razor site. There's a Kendo grid where one of the cells has a hyperlink to a pdf file, like this:
File 123
Clicking on the link opens a pdf in a new browser tab. The problem is, the URL is visible in the browser and can be changed to see another file. For example, the user could replace 123 with 456 and see File456.pdf. I need to do two things:
Hide the filename in the URL when the pdf is opened.
Hide the URL when the user hovers over the hyperlink.
Alternatively, I'd take a way to click the link (without the user seeing the URL) and download the file, but I think whether to download or view the file is browser specific.
I would just create an event to send the user back to the controller and handle the opening or download there, but the Kendo grid complicates that and this, as usual, needs to be changed right away. I'll take suggestions on how to manipulate the Kendo row to open a pdf, but I'm hoping there's a simple way to change just hide the URL from the user.
The problem is, the URL is visible in the browser and can be changed to see another file.
In my opinion the correct approach in this case would be not to pretend to hide something from the user, but rather know who your users are and implement authorization on your server. This means that if user A attempts to access file 123 that belongs to user B he gets denied. But if he attempts to access file 124 that belongs to him, then why care that he modified the url in the browser? After all user A accessed his own file. So instead of serving a static file directly, you could put those files into a folder that is not directly accessible and serve them through a controller action that will apply the necessary authorization logic (does the file that the user is trying to access actually belong to him before serving it?).
So my advice in this case for you would be to implement authorization on your server based on the resources that he is trying to access.
If you handle the redirection in JS I think it won't show the url. For example
<p onclick="redirect('http://example.com/Files/File123.pdf')">Click here for PDF</p>
<script>
function redirect(link)
{
window.location = link;
}
</script>

Display custom message after submitting a Google Form

I have a Google Form that allows user to enter their information. After they submit the form, the data is inserted to a Google spreadsheet as a new row.
However I want to show a dynamic message right after the form is submitted, overriding the original "thank you" message. The new message would display the information they just filled in, with an number assigned to him.
For example, Mary filled in her data and submit the form. Since Mary is the 5th person to submit this form, the message shows her number as 5.
Is there any way to achieve this? I have been studying Google App Script and HTML service but I am not sure if this is the correct way.
Please note that we have already using email to send out this message for several years however user strongly suggest that showing their ID right after form submission would make lots of things much easier.
Thank you very much!
Update
I have been working on it and now I am able to make a web page that inserts a new row to a spreadsheet. But another question: How to publish the web page? When I open the "/dev" link it works fine; However when I open the "/exec" link it says cannot find "Index.html" and I am sure there is a file called Index.html.
There is no way to add a custom confirmation message for the current user of the currently open Form. You can run code to change the confirmation message when the Form is submitted, but changing the confirmation message when the Form is submitted won't take affect until the NEXT Form is opened, and that's too late. So the next person to open the Form would get the confirmation message of the previous user.
You would need to convert everything to a stand alone HTML App for something like that.
Google just released a new version of Google Forms. In the settings you can change the confirmation page message for respondents. You can save a link to a web page in the custom message. So if you can create a web page with the data you want displayed, you should be able to save the link in the custom message.
In order to achieve the above-mentioned goal, you need to get the Google form on your web page. No, I am not talking about embedding the form to your web page but to create a stand alone HTML page. The reason behind doing so is since Google is a third party website, editing any code in Google forms is not possible and there is no other way (at least I could not figure out Yet) to place custom thank you page URL for the Google Form. You can even remove certain codes in your HTML page to make sure it doesn't look like or says Google form. Basically, to have custom URL you need to replace
Code to be replaced for custom Thank you url in Google form
In case you are not a techie, Playing with codes might break the code.This step by step blog for customising Google form might help you.

How to embed Google Compose Mail window in to Google Sheet Form?

I won't bore everyone reading this post with the entire background story of why I need to do this. However, I am looking to load the Google Compose Mail page in the HTML form loaded inside a Google Sheet I have created.
I know the link for the Compose email is https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=TO&su=SUBJECT&body=BODY
But I don't know if it is possible to have this link loaded as a view in the HTML service Form.
Does anyone know if this is possible and if so, how to do it?
I could always have a button to load the link in a separate tab... but I would like to have this all kept on screen to be more "professional" looking.
I was looking for an option to add an iframe or free code, but option exists. I recommend inserting a form if you are looking for a way to get data from users.
Its under "Insert", then "Form..."
Good Luck