I am trying to pull the data from websites. So I want to select 3 drop-down values in below URL but i cant change those values. example i want to select month ]CopyThat is:ie.document.querySelector("#fmonth1 option[value='1']")
CopyYou may need .Click on the end for selected. Can't test that url but also try:ie.document.querySelector("#fmonth1 option[value='1']").Selected = TrueCopyMore generally, if you know an element exists, and your syntax is correct, but you are still getting not set then it may be a timing issue where you need a longer wait (e.g. timed loop) before attempting to access, e.g.Const MAX_WAIT_SEC AsLong = 10Dim t AsDate, ele AsObject
t = Timer
Do
DoEvents
OnErrorResumeNextSet ele = ie.document.querySelector("#fmonth1")
OnErrorGoTo0If Timer - t > MAX_WAIT_SEC ThenExitDoLoopWhile ele IsNothingIfNot ele IsNothingThen
ele.Click 'may be needed to expose options
ie.document.querySelector("#fmonth1 option[value='1']").Selected = TrueEndIfCopy If inside of a parent iframe/frame you will need to navigate that first e.g.ie.document.getElementsByTagName("iframe")(0).contentDocument.querySelector("#fmonth1 option[value='1']").Selected = TrueCopy I tested the following now I can access the page:Public Sub MakeSelection()
Dim ie AsNew InternetExplorer
With ie
.Visible = True
.navigate "https://www.bseindia.com/markets/debt/BhavCopyDebt.aspx?expandable=6"While .Busy Or .readyState < 4: DoEvents: Wend
.document.getElementsByTagName("iframe")(0).contentDocument.querySelector("#fmonth1 option[value='1']").Selected = True
Stop '<==Delete me later
.Quit
End With
End Sub
Copy
Share
Post a Comment
for "Object Variable Or With Block Variable Not Set Getelementsbyname Vba"
Top Question
Right Floated Element Disappears When Using Columns In Firefox
I am using an ol element with column-count and column-gap p…
Weird Behavior Of Long Presses In Chrome And Firefox For Android
So, I found some weird behavior of long presses in Chrome a…
JQuery Hide ULs And Only Expand Once Particular Class Set (bit Like An Accordion)
Right folks, After battling with a JQuery Accordion trying …
Get Mediastreamtrack(audio) From Video
I want to record audio from video element alongside recordi…
CSS Oval Shape Cut Out From Div
The above image is what i'm trying to create but am hav…
Display Results From Select Dropdown Then Clone And Add Another Select
So I'm building two select dropdowns where the user sel…
What Are All Of The Inline-js Attributes New In HTML5?
I need a list of all of the attributes that can accept inli…
How To Select All D.data.id Ends In A Specified Word In A D3.tree Code?
After receiving an answer in my last question, I could modi…
How To Limit The HTML Table Records In Each Page
I am populating a table in my jsp which has more than 20 re…
Hidden Content Takes Up Height(isotope)
I am using this gallery to display portfolio items on my we…
November 2024
(35)
October 2024
(58)
September 2024
(21)
August 2024
(373)
July 2024
(339)
June 2024
(685)
May 2024
(1297)
April 2024
(793)
March 2024
(1520)
February 2024
(1647)
January 2024
(1345)
December 2023
(1391)
November 2023
(430)
October 2023
(565)
September 2023
(288)
August 2023
(335)
July 2023
(268)
June 2023
(345)
May 2023
(203)
April 2023
(147)
March 2023
(137)
February 2023
(177)
January 2023
(258)
December 2022
(140)
November 2022
(219)
October 2022
(175)
September 2022
(159)
August 2022
(289)
July 2022
(100)
Menu Halaman Statis
Beranda
© 2022 - Html5 Programming Language