Selenium WebDriver를 사용하여 WebElement의 HTML 소스에 액세스
웹 애플리케이션을 테스트할 때 웹 애플리케이션의 HTML 소스에 액세스해야 하는 경우가 종종 있습니다. 요소 또는 해당 하위 요소입니다. Selenium WebDriver는 전체 페이지 소스와 개별 요소의 소스를 모두 검색하는 메소드를 제공합니다.
요소의 HTML 소스를 얻으려면 get_attribute('innerHTML') 메소드를 사용하세요. 이 메서드는 요소 콘텐츠의 소스를 반환합니다. 예:
from selenium import webdriver wd = webdriver.Firefox() elem = wd.find_element_by_css_selector('#my-id') # Get the HTML source of the element's content element_source = elem.get_attribute('innerHTML')
요소와 해당 하위 요소의 HTML 소스에 대해 get_attribute('outerHTML') 메소드를 사용하십시오. 이 메소드는 현재 요소가 포함된 소스를 반환합니다.
innerHTML 및 externalHTML 속성은 표준 HTML 사양의 일부가 아닙니다. 이는 웹 브라우저에만 해당되며 모든 브라우저에서 지원되지 않을 수 있습니다.
위 내용은 Selenium WebDriver에서 WebElement의 HTML 소스에 어떻게 액세스합니까?의 상세 내용입니다. 자세한 내용은 PHP 중국어 웹사이트의 기타 관련 기사를 참조하세요!

forhandlinglargedatasetsinpython, usenumpyarraysforbetterperformance.1) numpyarraysarememory-effic andfasterfornumericaloperations.2) leveragevectorization foredtimecomplexity.4) managemoryusage withorfications data

inpython, listsusedyammoryAllocation과 함께 할당하고, whilempyarraysallocatefixedMemory.1) listsAllocatemememorythanneedInitiality.

Inpython, youcansspecthedatatypeyfelemeremodelerernspant.1) usenpynernrump.1) usenpynerp.dloatp.ploatm64, 포모 선례 전분자.

numpyissentialfornumericalcomputinginpythonduetoitsspeed, memory-efficiency 및 comperniveMathematicaticaltions

contiguousUousUousUlorAllocationScrucialForraysbecauseItAllowsOfficationAndFastElementAccess.1) ItenableSconstantTimeAccess, o (1), DuetodirectAddressCalculation.2) Itimprovesceeffiency theMultipleementFetchespercacheline.3) Itsimplififiesmomorym

slicepaythonlistisdoneusingthesyntaxlist [start : step : step] .here'showitworks : 1) startistheindexofthefirstelementtoinclude.2) stopistheindexofthefirstelemement.3) stepisincrementbetwetweentractionsoftortionsoflists

NumpyAllowsForVariousOperationsOnArrays : 1) BasicArithmeticLikeadDition, Subtraction, A 및 Division; 2) AdvancedOperationsSuchasmatrixmultiplication; 3) extrayintondsfordatamanipulation; 5) Ag

Arraysinpython, 특히 Stroughnumpyandpandas, areestentialfordataanalysis, setingspeedandefficiency


핫 AI 도구

Undresser.AI Undress
사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover
사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool
무료로 이미지를 벗다

Clothoff.io
AI 옷 제거제

Video Face Swap
완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

인기 기사

뜨거운 도구

드림위버 CS6
시각적 웹 개발 도구

PhpStorm 맥 버전
최신(2018.2.1) 전문 PHP 통합 개발 도구

WebStorm Mac 버전
유용한 JavaScript 개발 도구

메모장++7.3.1
사용하기 쉬운 무료 코드 편집기

Atom Editor Mac 버전 다운로드
가장 인기 있는 오픈 소스 편집기
