akimotiblog

日々学んだこと、日記などを定期的に更新していきます。

ACCESSで最寄りの交通機関の情報を取得するプログラム

ACCESSでのYahoo路線の交通機関の情報を取得するものです。

   Set EE = CreateObject("InternetExplorer.application")
   EE.Visible = False   'InternetExplorerを立ちあげない。
   EE.navigate ("https://beta-map.yahoo.co.jp/place?lat=" & wkeido & "&lon=" & wido & "&zoom=17")
   Sleep 4000
   If Nz([駅]) = "" Then
       strstation = Left(EE.Document.getElementsByClassName("Keyvalue__listItemRow")(0).innerHTML, InStr(EE.Document.getElementsByClassName("Keyvalue__listItemRow")(0).innerHTML, "駅") - 1)
       [駅] = strstation
   End If
   If Nz([沿線]) = "" Then
       [沿線] = Replace(Replace(EE.Document.getElementsByClassName("util-text--weak")(0).innerHTML, "(", ""), ")", "")
   nd If
   If Nz([徒歩その1/車]) = "" Then
       [徒歩その1/車] = Replace(EE.Document.getElementsByClassName("KeyvalueListItem__button")(0).innerHTML, "分", "")
   End If
   EE.Quit

自己紹介

akimoti

制作者について

あきもちです、25歳のwebデザイン、プログラム歴2ヶ月です。職業訓練校で勉強していました。今は勉強する日々です。頑張りますので是非よろしくお願いします。 学んだことメモ代わりに更新します。ラインスタンプも作ったりしています。