Browser Search
This is a simple program I wrote to perform batch searches against the search engine via a browser of choice. The program will perform x cycles of y searches, pausing z1 milliseconds between each cycle and z2 milliseconds between each search, using a specific browser.
For example, if you want to perform one cycle of 10 searches, pausing two seconds between each search, and use the Microsoft Edge browser:
> BrowserSearch.exe --cycles 1 --count 10 --pause 2000 --browser msedge ...
If you use --prefix
, each search will add a random prefix phrase, followed by the search words.
> BrowserSearch.exe --cycles 1 --count 10 --pause 2000 --browser msedge --prefix ...
You can pause n milliseconds between three cycles of the 10 searches:
> BrowserSearch.exe --cycles 3 --cyclePauseMs 1200000 --count 10 --pause 2000 --browser msedge ...
If you want to adjust the number of words per search:
> BrowserSearch.exe --cycles 3 --cyclePauseMs 1200000 --count 10 -pause 2000 --browser msedge --minWords 3 --maxWords 5 ...
There are a lot of command-line options to tweak things. You can see usage for the program using:
> BrowserSearch.exe --help
-c, --count
(Required. Number of searches to perform.)-b, --browser
((Default: Edge) OS command-line browser name (e.g. msedge, chrome, etc.).)-p, --pause
(Required. Milliseconds to pause between each search)--minWords
((Default: 2) The minimium number of search words.)--maxWords
((Default: 4) The maximum number of search words.)--cmdBeforeCycle
(OS command to execute before a search cycle (separate cmd from args using "::").)--cmdAfterCycle
(OS command to execute after a search cycle (separate cmd from args using "::").)--cmdBeforeCyclePauseMs
((Default: 0) Milliseconds to pause before executing cmdBeforeCycle (default = 0ms).)--cmdAfterCyclePauseMs
((Default: 0) Milliseconds to pause after excecuting cmdAfterCycle (default = 0ms).)--cycles
((Default: 1) The number of cycles, repeating the "count" searches.)--cyclePauseMs
((Default: 1200000) Milliseconds to pause after each cycle (default = 1200000ms).)--cmdBeforeCycleWaitToCompleteMs
((Default: 5000) Milliseconds to wait for "before" command to complete (default = 5000ms).)--cmdAfterCycleWaitToCompleteMs
((Default: 5000) Milliseconds to wait for "after" command to complete (default = 5000ms).)--startPauseMs
((Default: 0) Milliseconds to pause before starting (default = 0ms).)--prefix
(Adds a random search prefix to the search phrase (searchprefixes.txt).)--times
(Displays execution time summary, then exits.)
I have several scheduled tasks that perform searches using Edge and Chrome (a Chrome plugin is installed to simulate a mobile User Agent).
If you want to search using another engine rather than Bing, that can easily be changed in the source; see the FormatSearchEngineUrl
method.
Example The following example performs five cycles of 10 searches in intervals of 18 seconds, using 2-4 random words. A pause of 20 minutes (1200000ms) occurs after each cycle. The Edge browser is used. After each individual search is completed, an 18 second pause occurs (18000ms), then instances of msedge.exe are killed to fully close the Edge browser. Finally, a 5 second pause occurs after the kill command.
> BrowserSearch.exe --cycles 5 --cyclePauseMs 1200000 --count 10 --pause 18000 -b msedge --minWords 2 --maxWords 4 --cmdAfterCycle "taskkill::/F /IM msedge.exe" --cmdAfterCyclePauseMs 5000
The random search words used are in the searchwords.txt
file. The prefix phrases (--prefix
) for each search are found in the searchprefixes.txt
file.
Have fun.