I know that there is a option within Internet Explorer that I could use the manually export cookies. However, is it possible to have a Perl script to automate IE to export cookies to a text file or by using command shell?
I'm using Internet Explorer 11 for Windows 7. Thanks in advance!
I haven't tried it with Internet Explorer, but when I've had to do this task for other browsers, I found the file that the cookies are already in and parsed that directly. It's why there are so many HTTP::Cookies::* modules in my CPAN account.
There are also various Win32 modules to let you control Windows applications from Perl through the Windows APIs. I made a list of some examples that use Win32::OLE, for instance. There's one that plays Minesweeper for you!
Related
Overview
My goal is to write a Bash script on WSL2 that pulls data from the Brave browser's home page and stores it in a text file. Specifically, I would like to access the value for 'Brave Rewards' seen in this picture and store it in a Bash variable:
Issue
I can't figure out how to access this page programmatically. There's no URL that I can use to download it with wget or curl. All I can find is brave://rewards/, which doesn't work from curl or wget:
# ISSUE GETTING CONTENTS
content=$(wget brave://rewards/ -q -O -)
echo $content
# Blank line returned
The browser is the Windows version, which I can launch either from the shell on WSL2/Ubuntu (via xlaunch) or directly from Windows.
Is there any way that I can programmatically access the "Brave Rewards" value or the brave://rewards URL?
Unfortunately, this isn't something you'll be able to "scrape", as you seem to be trying. The brave://rewards page, as mentioned in the comments, is an internal browser page. You won't have access to this page from wget or any other software, regardless of whether it is WSL, pure Linux, etc.
The browser apparently communicates with api.rewards.brave.com to get this information, but as far as I can tell there is no documentation on that API.
There might be two possibilities for obtaining the information you want programmatically:
If you really want to "dig in", you can look at the source code (JavaScript and HTML) of brave://rewards from within the browser by starting the Developer tools (Ctrl+Shift+I). The main script is brave_rewards_page.bundle.js. It may be possible to reverse-engineer the script.
Perhaps a better option, depending on how often you would want to do this, is to attempt to script this via Python/Selenium/Chromedriver. Using this stack, you can "automate" the browser to open the brave://rewards page and access the contents of the <div> with the reward value.
Some tips for doing this from WSL2:
You will need to use the Linux version of Brave. Selenium on WSL2 won't be able to connect to the Windows Brave's chromedriver.
That means that you'll also need the ability to run GUI apps on WSL2. This can be most easily done if you have the ability to upgrade to Windows 11 with WSLg support. Alternatively, I prefer xrdp personally for accessing GUI apps in WSL2 on Windows 10. See this question and a separate answer I provided here for more details.
I need to have multiple versions of IE browser in my windows 7 for cross browser testing.
I checked for Standalone application, but nothing worked properly.
I know there is a F12 developer tool in windows which will switch the user agent, is it possible to call the iexplore.exe browser from command line along with the required browser version?
I have already got the trial version of spoon, but I am looking for a free solution.
I am not looking for any paid version of alternatives
I dont need procedures that involve creation of virtual machine as they will not work for me.
Kindly let me know if the above information is not clear or insufficient.
It's not possible to change the browser version from the command line.
The closest you can do and it's not at all recommend as it impacts every IE instance is to use the Browser Emulation feature control key (documentation) to change the default mode.
Related to another question on Superuser, I'm trying to run a Metro based application from the command-line. According to a comment on my superuser question, I could maybe find an answear on a PowerShell command or script. I already tried but found anything on any internet reference about PowerShell and Windows 8...
So, there is some specific way/command to call and run a Metro-style application from a PowerShell command on Windows 8?
There is no direct way to do this but there are a couple indirect ways.
vsdebuglaunchnotify, which comes with Visual Studio, can be called from PowerShell.
You could create your own exe that uses IApplicationActivationManager.
If the app is associated with any file types you could launch an associated file.
More information is covered in this thread on MSDN:
http://social.msdn.microsoft.com/Forums/en-US/windowsgeneraldevelopmentissues/thread/8d1b0861-5903-4289-8cb8-541ddaa012fb
Here's a blog post by Powertoe that uses the IApplicationActivationManager way of doing it:
http://powertoe.wordpress.com/2012/11/02/get-a-list-of-metro-apps-and-launch-them-in-windows-8-using-powershell/
He provides code here http://poshcode.org/3740 that provides a Start-MetroApp commandlet for powershell.
Alternatively: I think some Metro Apps have protocol handlers, so that you can talk to them via a URI (e.g. "appname:dosomething") but I'm not sure how widely used this is.
I loved the ability to open a file in textmate from other applications using the txmt://open/?url=file:// command. I can't seem to find anything similar for SublimeText 2, does anybody know how I can do this?
subl-handler is an app that maps textmate's txmt url protocol to Sublime Text. I haven't tried it myself, but looks like it's what you're looking for.
Available here: https://github.com/hiddenbek/subl-handler
(Side note: for windows users, there's this: https://bitbucket.org/sublimator/sublimeprotocol/src/)
Which operating system are you using?
If you are on the Windows OS this is easy enough to do by registering the file extension with the Windows Shell and then using the ShellExecute WIN32 API.
I'm doing a fair bit of work in Ruby recently, and using
ruby script/console
Is absolutely critical. However, I'm really disappointed with the default Windows console in Vista, especially in that there's a really annoying bug where moving the cursor back when at the bottom of the screen irregularly causes it to jump back. Anyone have a decent console app they use in Windows?
I use Console2.
I like the tabbed interface and that copy works properly if text breaks at the end of a line.
Are you resizing the console window? I've found that the ruby scripts (irb, etc) that use the readline library don't work correctly with resized console windows (in XP or Vista).
Effectively I believe that the readline library expects the console window to be 80 characters wide, anything else and it goes bezerk. So far I haven't found a way to fix it on windows without giving up other nice features.
I have had some pleasant experiences with rxvt (comes with cygwin, does not need an x server running). Putty is also often mentioned as a good alternative.
You could also try to get xterm working :)
Powershell
Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting language built on top of, and integrated with the .NET Framework. PowerShell provides full access to COM and WMI, enabling administrators to perform administrative tasks on both local and remote Windows systems.