Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Web scraping 关闭GEB刮削中的弹出窗口_Web Scraping_Geb - Fatal编程技术网

Web scraping 关闭GEB刮削中的弹出窗口

Web scraping 关闭GEB刮削中的弹出窗口,web-scraping,geb,Web Scraping,Geb,我想通过GEB在此站点busesromani.cl/site/中刮取表单,但出现以下错误 org.openqa.selenium.WebDriverException:未知错误: 元素在点191、238处不可单击。其他元素将收到单击: 这是因为此网站中的弹出窗口。 有人能帮我解决这个问题吗 这是刮码 def processRoute(def route, def params) { def browser = params.browser browser.drive {

我想通过GEB在此站点busesromani.cl/site/中刮取表单,但出现以下错误

org.openqa.selenium.WebDriverException:未知错误: 元素在点191、238处不可单击。其他元素将收到单击:

这是因为此网站中的弹出窗口。 有人能帮我解决这个问题吗

这是刮码

  def processRoute(def route, def params) {
    def browser = params.browser
    browser.drive {

        log.info "Processing route ${route.routeName}"
        go "http://www.busesromani.cl/site/"

        def startCity = route.startLocation
        def endCity = route.endlocation
        waitFor(20) { $("div form#form").verifyNotEmpty() }
        def idaRadio = $("#si")
        idaRadio.verifyNotEmpty()
        idaRadio.click()
        def origin = $("#origen")
        origin.verifyNotEmpty()
        try {
            origin.value(startCity)
            log.info "Set origin to $startCity"
        } catch (Exception e) {
            log.error "Error setting origin: ${startCity}" + e
            return
        }

        def datefield = $("#Partida")
        datefield.verifyNotEmpty()

        def date = params.date
        log.info "Got the Date field, setting date to $date"

        js.exec("window.document.getElementById('cal-field-1').value='$date';")
        log.info "Ran the javascript to set date"
        def destination = $("#destino")

        destination.verifyNotEmpty()
        try {
            destination.value(endCity)
            log.info "Set destination to $endCity"
        } catch (Exception e) {
            log.info "Error setting destination: ${endCity}" + e
            return
        }

        def button = $("input.btn fl-right")
        button.verifyNotEmpty()
        button.click()

    } // browser
 }

请分享你的代码!好的,我分享了代码。你能告诉我哪一行是191吗?