1
私はスクリプトから外側のHTMLを持っており、その中から都市のリストを取得する必要があります。スクリプトの外側のhtmlから値を取得する方法
私はこれでHTMLとしてスクリプトを回収することによってそれを取得しようとしてきた:私は「cities
」というを取得する必要があり
<html>
<head>
<script>
NCM.Registry.add('PreHomeStatic', 'PreHome_1485892226002', {
backgroundColor: '#f1f1f1',
backgroundImage: '',
subscriberUrl: '/cliente',
notSubscriberUrl: '/home',
defaultCityName: "sao_paulo",
defaultCityId: '1366122212339',
cityNotFoundMessage: 'Os serviços NET não estão disponíveis para sua cidade TEST',
cityPlaceholder: 'Digite Sua Cidade',
subscriberLabel: 'Já é <b>cliente NET?</b>',
footerNote: 'Rodapé',
cities: [{"id_wcs":"1374010568098","id":"almirante_tamandare","value":"Almirante Tamandaré","tokens":["almirante","tamandare","Almirante","Tamandaré"]},{"id_wcs":"1374019924528","id":"alvorada","value":"Alvorada"...
:
Document citiesHTML = Jsoup.parse(driver.findElement(By.xpath("/html/body/section/script")).getAttribute("outerHTML"));
そのラインからの復帰でありますアレイ。