ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to control radio buttons on a web page? (https://www.excelbanter.com/excel-programming/368244-how-control-radio-buttons-web-page.html)

festdaddy

How to control radio buttons on a web page?
 
I'm trying to automate getting some building permit info from a website
(http://censtats.census.gov/bldg/bldgprmt.shtml). I've got the state
selection and the submit button working ok, but at the top is a radio
button selector for Place or County, and I can't figure out how to
select County. Here is what I have so far, with some of the things
I've tried:

Sub county_permit_test()

Const URL As String = _
"http://censtats.census.gov/bldg/bldgprmt.shtml"
Dim ie As Object
Set ie = CreateObject("internetexplorer.application")

With ie
.Visible = True
.Navigate URL
Do Until ie.ReadyState = READYSTATE_COMPLETE And Not
ie.Busy: Loop
With .Document.all
'.ret_opt.value("county").checked
'.Item("radio").Value = "county"
'.Item("ret_opt").Value("county") = Checked
.state.Value = "25Massachusetts"
End With
.Document.forms(0).submit
End With
End Sub



All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com