Answer the question
In order to leave comments, you need to log in
C# webbrowser and image loading?
Good afternoon!
There is a lot of work to be done to search for images on the Internet. I remembered the C# course and decided to optimize my work with a Windows Forms application and a Webbrowser control. At the moment, the application reads a line from a text file, deletes it, goes to images.google.com, inserts a search request into the form, goes to the images page. Further, the idea is this:
1. The user selects the desired image and, placing the cursor over it, presses a key on the keyboard.
2. The application simulates pressing RMB and selecting the "Save image as" menu item.
3. Inserts the file name from the variable or clipboard into the explorer window that opens, saves the image.
Which of the last two points can be implemented in C#?
If it is difficult or impossible, maybe it is worth downloading the image not to a computer, but to a web server and then downloading it via FTP from there?
I'm interested in any thoughts on this.
Answer the question
In order to leave comments, you need to log in
why clave? than a regular Click(); or DoubleClick(); not satisfied?
downloaded via web client / httpclient etc.
BitMapImage s = client.DownloadFile("string path");
or
var s = client.DownloadFile("string path");
Bitmapimage r = s as Bitmapimage;
points 2 and 3 can be implemented in one form or another,
but point 1 destroys all automation in the bud - if you need to select the necessary images manually, then I think it will be convenient to do it in a regular browser (given the buggy component of the Webbrowser)
Alternatively, load the first N images from the search results and deal with them already locally on your computer.
I was a little dumb. On images.google.com, right next to the image, under the "Show Image" button, there is a direct link to the image. You can click on it to hang the download.
I’ll write the essence of the application itself here so that it would be clearer what the question is.
1. Copy the search query from the CSV file
2. Paste the query into the search
3. Find a suitable image (size, background, no watermarks and logos)
4. Download the image to your computer
5. Go to the product card of one of the stores and upload the image
6 Mark in the CSV file the execution of the operation
Repeat the action approximately 40 thousand times.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question