Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get icon/image from web page... 1

Status
Not open for further replies.

2009luca

Programmer
Jul 27, 2013
222
IT
Based this url: Link, possible to loop all banck in table and get the related icon, and save each image/icon in c:
tks.

see image attached for example.

Link
 
Why don't you just ask the web site owner to dump their database for you?

the website you're trying to steal from said:
© 2019 Gwind srl

Is there a legitimate reason why you need to steal this data?
 
strongm, tk for reply.

my poor test code:

Option Explicit
Sub LeggiDatiID()

On Error GoTo Errore

Dim objIE As InternetExplorer, R As Integer, numRighe As Integer
'Dim sh1 As Worksheet


'Set sh1 = ThisWorkbook.Sheets("foglio1")

Dim objShell As Shell, mytext As String
Dim objExplorer As ShellFolderView
Dim obj As Object

Set objShell = New Shell
For Each obj In objShell.Windows

If TypeName(obj.Document) = "HTMLDocument" Then
Set objIE = obj
If objIE.LocationURL Like "* Then
Exit For
End If
End If
Next obj

With objIE
'rigaXl = 2
'sh1.Range("2:" & Rows.Count).ClearContents
'sh1.Range("d2:d" & Rows.Count).Interior.ColorIndex = xlNone


'.Navigate mydir & myFile
'Do While .Busy: DoEvents: Loop
'Do While .readystate <> 4: DoEvents: Loop

'Stop
'Open "\mylog.txt" For Output As #1

'rigaOut = 1
With .Document
'numTab = .all.tags("table").Length

'For t = 0 To numTab - 1

numRighe = .all.tags("table")(2).Rows.Length

For R = 1 To numRighe - 1
'numCelle = .all.tags("table")(2).Rows(R).Cells.Length
'For c = 0 To numCelle - 1
mytext = .all.tags("table")(2).Rows(R).Cells(0).innertext
Debug.Print mytext
mytext = .all.tags("table")(2).Rows(R).Cells(1).innertext
Debug.Print mytext
mytext = .all.tags("table")(2).Rows(R).Cells(2).innertext
Debug.Print mytext
'Next
Next
'Next
End With

'myFile = Dir
'Loop
End With

'objIE.Quit
Set objIE = Nothing

Exit Sub

Errore:

MsgBox "Errore " & Err.Description, vbOKOnly
'a = 1
Resume Next
Set objIE = Nothing

End Sub
 
spamjim, website copyright generally covers the code, design and layout of the site, it does not cover the data the website may display. And in this case, even better, the website's own legal definitions expressly state "The use and partial reproduction of the contents of the Site is permitted" (or , originally, "È consentito l'utilizzo e la riproduzione parziale dei contenuti del Sito").

So I don't think we need to worry that 2009luca is doing anything wrong.
 
strongm, I'm aware there are some limited cases where data can be taken from a web site. Are not icons a core element to the design and layout of a site? They are design. These icons are a significant product of the tuttitalia.it website's design. Even Google has had significant legal conflicts with "indexing" images from other sites.

Tuttitalia.it said:
"The use and partial reproduction of the contents of the Site is permitted provided that Tuttitalia.it is always cited as a source and, if applicable, that a direct and visible link is inserted to or to an internal page."

This Legal Notice does not fully define the intent of "partial". Nor does the OP note if they will comply with the condition of attribution.

Aside from legal concerns, there is a more important technical concern. Many web sites employ technology to prevent scraping or other abusive access acts. The OP might develop a wonderful solution using 20 year old VB tech but that solution may still fail on a web site using current anti-leeching methods to serve documents.

EDIT:
strongm said:
So I don't think we need to worry that 2009luca is doing anything wrong.

There is now that suspicion of wrongdoing as the question of intent was asked and left unanswered by the OP.
 
Strongm,

My USA company once had dealing with a USA competitor that was scraping our web site and publishing on their own site. This was just the data that you believe to be safe to swipe. After the competitor failed to act on our cease/desist notice, I sent DMCA take-down notices to search engines and to their web hosting provider. I then copied those notices to the competitor and reminded them of the likely consequence from their hosting provider. The terms of the hosting provider indicated they would more likely shutdown the domain's HTTP service than try to surgically remove the copied data. The competitor magically had a change of heart and removed our data.

Certainly, there could be a difference of laws in Italy.
 
>you believe to be safe to swipe

I didn't say it was necessarily safe to swipe, I said you could not copyright it, which remains true - both in the US and in Europe data cannot be copyrighted. And then simply pointed out that the site expressly allowed the data to be used in any case (sure, there are some conditions - mostly only applicable to scenario where you intend to republish the data or the data extract - but that isn't the point). So I still think accusing the OP of theft is a bit of an overreaction.
 
2009luca - so your code seems to indicate that you are not just trying to get the icons, but also all the other info for each bank. Is that correct?

if all you want is the icons, then something like the following would work for the given page:

Code:
[blue]Option Explicit

Public Sub GetBankIcons()
    Dim objIE As InternetExplorer
    Dim lp As Integer
    
    Set objIE = New InternetExplorer
    objIE.Navigate2 "[URL unfurl="true"]https://www.tuttitalia.it/banche/classifica/"[/URL]
    
    With objIE.Document
        Dim freddy As IHTMLElementCollection
        With .getElementsByClassName("ao")
            For lp = 0 To .Length - 1
                Debug.Print .Item(lp).src
                SaveFileFromURL .Item(lp).src, "<target path>" [green] ' Change target path to the path you want to save the icons to[/green]
            Next
        End With
    End With
End Sub

Public Sub SaveFileFromURL(url As String, strPath As String, Optional filename As String)
    Dim adTypeText As Long
    Dim adSaveCreateOverWrite  As Long
    Dim BinaryStream As Object
    Dim httpreq As Object
    Dim fso As New FileSystemObject
    
    adTypeText = 1
    adSaveCreateOverWrite = 2
    
    If filename = "" Then filename = fso.GetFileName(url)
    
    Set httpreq = CreateObject("Msxml2.XMLHttp.6.0")
    httpreq.Open "GET", url, False
    httpreq.send

    If httpreq.Status = 200 Then
        Set BinaryStream = CreateObject("ADODB.Stream")
        BinaryStream.Type = adTypeText
        BinaryStream.Open
        BinaryStream.Write httpreq.responseBody
        BinaryStream.SaveToFile fso.BuildPath(strPath, filename), adSaveCreateOverWrite
    End If
End Sub[/blue]
 
Strongm,
There's no accusation. The question of legality is not being made to blame the OP.

You are the one that said design is generally covered by website copyright ...and this topic is about swiping the designed icons/images from a web page.

This entire exercise dances on the edge of insanity for a desktop application as most any web browser will let you save the entire page, with individual graphic files.
 
The icons in question appear to be those of many companies.

It is unclear that Tuttitalia.it has the rights from the individual trademark or copyright holders to give away.
 
>No accusation

perhaps I was being oversensitive - but in your very first post in this thread you state both

[tt]Quote (the website you're trying to steal from)[/tt]

and

[tt]Is there a legitimate reason why you need to steal this data?[/tt]

which sounds pretty accusatory to me

As for "swiping the designed icons/images" - the icons are the logos of the banks. The website cannot claim copyright on or ownership of them, not least because logos are generally trademarked rather than copyrighted (and the site's legal terms clearly acknowledges that the trademarks belong to the owners, and not the site). 2009lorca has a much right to take copies of them as the site does. It is far from being "a significant product of the tuttitalia.it website's design" - the company behind the website did not create or design them, and simply placing them in a table is not an expression of design; there's plenty of case history going back to e.g. Feist Publications, Inc., v. Rural Telephone Service Co to support this.
 
strongm said:
the icons are the logos of the banks.

Nope. This is why we've been having a completely disconnected conversation. You're not even paying attention to what's being stolen.

Those are far from official trademarks of banks. They are tuttitalia.it's artistic interpretations of the logos of banks.

Observe tuttitalia.it's 16 pixel icon for Banco BPM. That is not the Banco BPM trademark. It is just a portion of it, as tuttitalia.it chose to interpret it and to render it in a unique design (which you recognize as designed material protected by copyright).

As a developer, you should certainly know that you can't simply swipe icons protected by copyright for your applications. Even Microsoft limits its licensing of its icon set to paid versions of its development software.
 
Hi strongm!
I have no words, the code work perfect!
Tkx.

... but really in my original code posted i need, during the loop in each rows, to get also:

the name of bank, ABI and Numero Succursali

for example for first banck:

Intesa Sanpaolo, 03069, 3.527

can you modify, for me?


 
I am well aware of what is being talked about. Unfortunately, despite your claims otherwise, a work must meet minimal standards of originality in order to qualify for copyright. Sampling, resizing or modifying the proportions of a logo (or an original image), or providing an 'artistic impression' does not achieve that standard, and does not allow you to claim copyright or a trademark on the derived version; it remains with the original copyright holder or trademark owner. This has all been repeatedly covered in various copyright case law. The bank logo icons on the site cannot be copyrighted by Gwind srl. However, assuming the website is following the law correctly they will have sought permission to use, modify and display the logos from the actual copyright holder. The Content Rights, as I previously pointed out, consequently explicitly allow both the use and partial reproduction (a term designed to protect against someone cloning the entire site, rather than only letting you reproduce part of an individual page) of the contents of the Site, which includes those derived works. Sure, if you present your reproduction anywhere you need to cite Tuttitalia.it as a source, but that's hardly an onerous task.

Of course there does remain the possibility that Gwind srl have not sought and gained permission to use the trademarked logos, in which case they do not have the right to grant site visitors the right to use or reproduce any of that copyright content, but that is a slightly different issue.


 
Strongm,
have error on page 2 of table, bank with ABI=08728, not have a icon in row.
can i escape this error?

Tks
 
Some simple error trapping should deal with that. Got to leave some things up to you ...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top