1
나는 스크립트의 바깥 쪽 HTML을 가지고 있는데 그 안쪽에 도시 목록을 가져와야합니다.스크립트의 바깥 쪽 html에서 값을 얻는 방법
나는이와 HTML과 스크립트를 복구하여 그것을 얻으려고 봤는데 : 그 라인의 반환은
Document citiesHTML = Jsoup.parse(driver.findElement(By.xpath("/html/body/section/script")).getAttribute("outerHTML"));
입니다
:<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"...
것은 내가 "cities
"를 것을 얻을 필요 정렬.