Skip to content

Some sites do not have access to full content #763

@gkj17

Description

@gkj17
@Test
    fun testGetVideoHotRank() {
        val webClient = WebClient(BrowserVersion.CHROME)

        webClient.options.isThrowExceptionOnScriptError = false
        webClient.options.isThrowExceptionOnFailingStatusCode = false
        webClient.options.isCssEnabled = true
        webClient.options.isJavaScriptEnabled = true
        webClient.ajaxController = NicelyResynchronizingAjaxController()

        var page: HtmlPage? = null
        try {
            page = webClient.getPage("https://t.youku.com/yep/page/s/hot_search_rank")
        } catch (e: Exception) {
            e.printStackTrace()
        } finally {
            webClient.close()
        }

        webClient.waitForBackgroundJavaScript(30000)

        val pageXml = page?.asXml()
        println(pageXml.toString())
    }

When visiting this site, it seems that the content is not displaying because the js is not loading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions