• How to create a google search url?
  • How to parse the first picture from the answer?
  • and where is my mistake? code in the picture

    1 answer 1

    Conducted a small investigation. Of course, it has no relation to the declared tags, but I would solve the problem as follows.

    1. Use the link -

      https://www.google.com/search?newwindow=1&hl=en&tbm=isch&source=hp&biw=1920&bih=935&ei=yRAgWvD8I-SP6ASd1YsI&q=russia

    2. We take as the word for the query - Russia - we will attribute at the very end

    3. Get (download) page -

    enter image description here

    1. We retrieve the form reference from the page code (we, for example, need the first one) -

      https://www.google.com/imgres?imgurl=https%3A%2F%2Fupload. 2529.svg.png & imgrefurl = https% 3A% 2F% 2Fen.wikipedia.org% 2Fwiki% 2FRussia & docid = mfXGovdbdkbfSM & tbnid = 3jNUwOHcizThGM% 3A & vet = 10ahUKEwjJjKiEvebXAhVIQJoKHRZXALkQMwg7KAAwAA..i & w = 600 & h = 349 & hl = ru & bih = 935 & biw = 1920 & q = russia & ved = 0ahUKEwjJjKiEvebXAhVIQJoKHRZXALkQMwg7KAAwAA & iact = mrc & uact = 8

    2. Follow this link and get (download) the following page -

    enter image description here

    1. Extract the link from the code with the end of the image format -

      https://upload.wikimedia.org/wikipedia/commons/thumb/7/7d/Map_of_federal_subjects_of_Russia_%282014%29.svg/600px-Map_of_federal_subjects_of_Russia_%282014%29.svg.rp

    She is part of the link to step 4. There you can cut it off, return slashes and other special characters, for example, replacing %2F with / .

    You can retrieve links using a regular program or special programs like TextPipe .