从Url读取的Selenium Json和xml使用Java打开方法

问题描述 投票:1回答:1

我需要知道可以从硒ChromeDrive获得json数据或xml数据吗?

{
    "name": "Rajeev",
    "age": 25,
    "address": {
        "city": "Bangalore",
        "state": "Karnataka",
        "country": "India"
    }
}
java selenium-webdriver selenium-chromedriver
1个回答
1
投票

容易做这个

webDriver.getPageSource()

getPageSource()方法,用于获取Web视图中的所有内容,您可以看到只使用正则表达式删除了必要的标签

Introduction to driver.getPageSource()

© www.soinside.com 2019 - 2024. All rights reserved.