open HTML from PowerShell with URL parameters - html

I am trying to open a HTML file in Microsoft Edge browser from PowerShell.
Below code opens HTML in Microsoft edge
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html')
How to pass some values from PowerShell to HTML using URL parameters.
I wanted something like below code
&'C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe' #('d:\test.html?testvalue1=45&testvalue2=50')
But the above code opens browser but cannot able to load test.html. Using JavaScript I want to get values from URL which is passed by PowerShell.

You could try the command below.
Start-Process microsoft-edge:"https://localhost?testvalue1=45&testvalue2=50"
Output:

One way to accomplish this is to use the "Start-Process" cmdlet
Start-Process 'C:\Program Files (x86)\Mozilla Firefox\firefox.exe' C:\Web\index.html
This however only works if you know the path. For some reason Powershell fails to translate for example .\index.html to a proper path.

Related

HTML Excel Link Can't Find File?

I'm using this string before a pathway to a local excel document:
ms-excel:ofe|u|
The filepath looks like something like this "Y:/My Files/Organization/This Folder/
When clicking on the rendered link, Excel launches but I get the "Sorry, can't find file" alert which displays the failed path, wherein each space and back-slash are replaced with %20
Am I using that aforementioned ms-excel string correctly?
Thanks!
ms-excel:ofe|u|file:///${batchPath}
The missing bit was file:/// along that string. With that, the locally saved filepaths launched without issue!

How can I parse a link within locally stored html using python?

I am trying to extract text from a link within an html file that is locally stored. The link is as follows:
file:///Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html#body.202003310521728.1
I can't seem to use open() to access this link. I tried the following but does not work.
open(file:///Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html#body.202003310521728.1)
How can I access this link?
I added screenshots of jupyter notebook for more elaboration
You have to pass the actual file path to the function
Should be something like:
open("C:/Users/Users/my_name/Dropbox/folder_name/wisenews/18Jan2021%20(1).html")

Excel pass url with parameters to browser

How is it possible to open local HTML file passing parameters from Excel sheet? It seems that passing the parameters works just for URL not for the file protocol.
does not work:
=HYPERLINK("file:///C:/temp/html/new2017.htm?test=123","Search")
works:
=HYPERLINK("http://localhost/html/new2017.htm?test=123","Search")
What would be a way around it?

Persistent Edit In Chrome DevTools

There's an online tool that I'd like to tweak. It depends upon a JSON file. The easiest way for me to make the changes that I desire is to edit this JSON file directly, which I'm doing using the "Edit text" feature of Chrome DevTools. Next, I need to reload the main webpage so that it fetches the edited JSON file. Of course, this doesn't work because the webpage fetches the resource from the server. Is there any way to make the webpage temporarily load my edited JSON file?

IrfanView generate HTML file from Thumbnails in cmd

I try generate from IrfanView cmd interface HTML page from directory with Thumbnails, but I can't find any parameter or options, how I can do it.
I can generate Thumbnails via:
"C:\Program Files (x86)\IrfanView\i_view32.exe" "C:\Test\FullScreens\*.jpg" /resize=(100,100) /aspectratio /resample /convert="C:\Test\*.png
I can't find this in cmd:
It is possible to realize this?
Thank you, Regards,
  Peter
The text file i_options.txt in program files folder of IrfanView contains all options which can be used on command line. There is no option to create an HTML file. This must be done via GUI using the captured dialog.
But after creating the thumbnails for the images, it would be of course possible to create with a batch file also the HTML file using the commands echo, for, if and set with output created by several echo command lines redirected to the HTML file to create. Executing in a command prompt window help echo, help for, ... displays help on those internal commands of command interpreter cmd.
However, it would be a lot of work to create a batch file with all the parameters of the dialog. And it would make the batch file slower to really support all those parameters. A tailor-made batch file for creating the HTML file exactly like you want them would be much easier to code.
I suggest to try by yourself coding the batch file to create the HTML file. Create a new question with a link to this question, if you have somewhere a problem which you can't solve by yourself. Post in this question the batch code you have so far and the content of the HTML file created by IrfanView which should be instead created by the batch file.