江湖告急:这个网页表单中各省下的地市选择搞不定哇

宋克阳 11月前 639

这是一个问卷星的模拟调查网页:https://www.wjx.top/vj/Omapnmu.aspx


省份选择可以通过“设置元素选择”搞定,但各省下辖的城市是让“勾选"的,这个咋弄呀!


_江湖告急:这个网页表单中各省下的地市选择搞不定哇


用获取子元素能得到一个全是代码的数组,按网友说的在源码中去掉一个逗号和0,改成输出为字典,能得到城市名,但接下来不会操作了。(请大神赐教!万分感谢!!)

_江湖告急:这个网页表单中各省下的地市选择搞不定哇


最新回复 (13)
  • 2
    设置元素勾选就可以了 ,勾选内容设置变量,

    Dim temp = ""
    temp = "杭州"
    #icon("@res:jbq1niaq-p1mb-3jib-j3l6-4aq55e5tsf4b.png")
    UiElement.SetCheck({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","id":"PDF_i_chezchenz"},{"tag":"INPUT","aaname":temp}]},True,{"bContinueOnError":False,"iDelayAfter":0,"iDelayBefore":0})


  • BOWEN_批判者 11月前
    3
    查看后台代码,看看网页是不是使用的单选框实现的该功能,如果是,则使用勾选,如果不是,爬取数据获取id,进行点击操作
  • 宋克阳 11月前
    4
    勾选目标没法确定呀!
  • 祖咏 11月前
    5
    就是个文本框,readonly=false 直接往里写就行
  • 6
    勾选目标城市名字都无法确定,都不知道你要弄啥,获取全部名字,难道要遍历勾选呀
  • 锦途工作室 11月前
    7


    直接写进去不行吗(写入文本那里设一个变量)?

  • 与UiBot共舞 11月前
    8
    Dim 省份 = ""
    Dim 性别 = ""
    Dim 姓名 = ""
    Dim 城市 = ""
    姓名 = "王五"
    性别 = "女"
    省份 = "黑龙江"
    城市 = "黑河"
    #icon("@res:l0g4macu-qucl-t902-63ki-u2artcekd5h0.png")
    UiElement.SetValue({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"TEXTAREA","id":"q1"}]},姓名,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
    #icon("@res:q469k3gh-m65o-nth1-qk2k-2iiqesj82ifm.png")
    Keyboard.PressKey({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"LABEL","aaname":性别}]},"Enter",20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sKeyModifiers":[],"sSimulate":"simulate","bClickBeforeInput":False})
    #icon("@res:af0ef01c-7gfr-heqa-v9i3-7m11emhjmoqp.png")
    Mouse.Action({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"TEXTAREA","id":"q3"}]},"left","click",10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sCursorPosition":"Center","iCursorOffsetX":0,"iCursorOffsetY":0,"sKeyModifiers":[],"sSimulate":"simulate","bMoveSmoothly":False})
    #icon("@res:340e6nit-p60c-6fjp-4pg5-ihjf8ve4lo9l.png")
    UiElement.SetSelect({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","id":"PDF_i_chezchenz"},{"tag":"SELECT"}]},省份,"text",{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200})
    #icon("@res:2jmu7lfh-gv8c-8fh0-5l7e-ov7davla3g74.png")
    Keyboard.PressKey({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","id":"PDF_i_chezchenz"},{"tag":"LABEL","aaname":城市}]},"Enter",20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sKeyModifiers":[],"sSimulate":"simulate","bClickBeforeInput":False})
    #icon("@res:atqvk6qr-true-8l7n-rhqk-tghoeertjhen.png")
    Keyboard.PressKey({"wnd":[{"cls":"Chrome_WidgetWin_1","title":"*","app":"chrome"},{"cls":"Chrome_RenderWidgetHostHWND","title":"Chrome Legacy Window"}],"html":[{"tag":"IFRAME","id":"PDF_i_chezchenz"},{"tag":"INPUT","type":"button"}]},"Enter",20,10000,{"bContinueOnError":False,"iDelayAfter":300,"iDelayBefore":200,"bSetForeground":True,"sKeyModifiers":[],"sSimulate":"simulate","bClickBeforeInput":False})
  • 与UiBot共舞 11月前
    9



  • 与UiBot共舞 11月前
    10
    直接写入  也是可行的
  • 萌新大白熊 11月前
    11
    直接设置元素选择估计就行的吧?如果不好使,可以考虑用tab键+enter键试试看能否选择
  • 宋克阳 10月前
    12
    谢谢楼上各位网友的热心相助!
    问题已解决:目标元素-----设置元素文本。OK
    之前一直认为网页中下拉选择省份和点击勾选省辖市必须得通过鼠标点击或设置元素勾选、设置元素选择来实现,根本没想到通过“设置元素文本”来一次性完成省份和所在市的选择。原来选择也是可以通过设置文本来完成。
    另外,浏览器一定得先安装uibot扩展插件。
    再次感谢各位的热心相助!!
  • hhqx 13天前
    13
    我也遇到这个问题了,无从下手哇,怎么根据数据选择相应单选框啊?
  • A784 12天前
    14
    408977465
返回
发新帖