0

I would like to use WKWebView to show the webpage which is the road condition in Iceland. I using the following code, but it will show the whole webpage.

  @IBOutlet weak var webView: WKWebView!
override func viewDidLoad() {

    super.viewDidLoad()

    if let url = URL(string: "http://www.road.is/travel-info/road-conditions-and-weather/entire-iceland-road-conditions-map/"){
        let request = URLRequest(url: url)
        webView.load(request)
    }
}

I only want to show the picture below: enter image description here

because this is not only a static picture, this includes javascript and jquery. I can not just download it as a picture and show by using image view.

how can I only load this interactive picture by using webview? thanks!

Penny Chen
  • 79
  • 1
  • 10

1 Answers1

0

You may have to parse html to find.

see this question/answer Reading HTML content from a UIWebView

Inspecting the webpage I found the image link: http://www.vegagerdin.is/vgdata/faerd/faerdarkort/sudurland.png

Gehlen
  • 160
  • 1
  • 15