Skip to content
Advertisement

why nothing is returned when reading distance displayed on the site mentioned in the body using selenium webdriver

I am trying to read distance value from ‘Distance by Land Transport’ field from the site ( https://www.freemaptools.com/distance-between-canada-postcodes.htm) but I am getting nothing though the calculated distance value is displaying in the field. Below is my code and the site used.

Questions:

  1. why I am getting nothing? ( please see below code String variable: strDist shows nothing)
  2. Interestingly, when I did inspect the element the value shows 0.00. please see below screen capture.

It looks like I am not understanding something here.

JavaScript

enter image description here

Advertisement

Answer

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement