Saving images in the WebView as files

Post

Posted
Rating:
#1 (In Topic #114)
Trainee
 In Firefox, Right-Clicking on an image will usually allow one to save the image to a local file. I am trying to do the same sort of thing from web pages displayed in a Qt WebView.
It is not too difficult to extract the link to the image source from the WebView, for example, "
Image

(Click to enlarge)

", but I don't know how to locate or specify the path to the source file within this link so that the file can be copied to a local folder.
I would be grateful for any suggestions.
bazzvn
Online now: No Back to the top

Post

Posted
Rating:
#2
Avatar
Regular
jornmo is in the usergroup ‘Regular’
If you are asking how to save it? Then look at this: /comp/gb.net.curl/httpclient - Gambas Documentation

If you are asking how to extract the filename from the URL, try this:

Code (gambas)

  1. Dim sFileName As String
  2. Dim sURL As String = "someURL"
  3. sFileName = Split(sURL, "/").Reverse()[0]
  4.  

Online now: No Back to the top

Post

Posted
Rating:
#3
Trainee
 Thank you Jornmo.  It was the former, how to save the file.  I never thought to look at the gb.net component, but the wiki link you posted looks like it will solve my problem. Much appreciated.
bazzvn
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
jornmo is in the usergroup ‘Regular’
You may also find that gb.xml.html:

/comp/gb.xml.html - Gambas Documentation

is a good alternative to the webkit component for web scraping :)

I just scraped 66 pages in 5-10 seconds here the other day with this method myself.

Online now: No Back to the top
1 guest and 0 members have just viewed this.