Git Product home page Git Product logo

selenium_visualization's Introduction

selenium_visualization

Selenium Python 모듈은 Selenium WebDriver를 제어하는 API를 제공한다. Selenium으로 웹페이지와 상호작용하기 위해서는 웹페이지의 HTML상의 element를 선택하는 과정이 필요한데, 해당 과정은 여러 번의 시행착오를 통해 내가 찾고 싶은 element의 경로를 찾을 수 있다. 해당 과정은 반복적이고 불필요하며, 파일 디렉토리에서 cd와 ls를 여러 번 반복하는 것과 유사하다.

이러한 문제점을 해결하고자, 파일 관리자에서 디렉토리와 파일들을 트리 형태로 나타내는 것처럼 Selenium의 element들을 트리 형태로 시각화하는 프로젝트를 실행하게 되었다.

Demo link:
https://youtu.be/WxnLk0PqI40

목적

selenium을 사용하는데에 있어 내가 원하는 element의 경로를 찾는 과정이 항상 힘들었다.

마치 내가 원하는 디랙토리 경로를 가기 위해 일일이 ls 하고 cd 하고 ls 하고 cd 하는 느낌이다.

  1. 어떤 element에 대해서 하위 element의 정보를 tree 구조로 보여줌

e.g. e.tree() -> 하위 element가 모두 보여짐

-> 이때 depth나 attribute 표시 여부를 설정할 수 있음

  1. tree에서 각 element에 대한 고유 번호를 입력하면 해당 element에 대한 경로를 return 받을 수 있음

이 경로값을 python 코드에 쉽게 넣을 수 있다.

ToDo

  • selenium의 WebElement의 id만으로 선택하기
  • 특정 element에 대한 자식 element 리스트 출력하기
  • 기존의 패키지에 추가할지, 새로운 패키지를 만들지 결정하기

example

body = driver.find_element_by_tag_name("body")
<selenium.webdriver.remote.webelement.WebElement (session="3d8d880fc4bedfbc781afa8b62d094d3", element="80153561-a62f-42a7-acc2-ea5e03c089ec")>

type(body)
<class 'selenium.webdriver.remote.webelement.WebElement'>

body.id
'80153561-a62f-42a7-acc2-ea5e03c089ec'

useful URLs

selenium_visualization's People

Contributors

00dhkim avatar skeep194 avatar dja314159 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.