반응형
import json
def get_page_json(self):
driver = self.driver
search_result = ""
search_result = driver.find_element(By.CSS_SELECTOR, "body").get_attribute("textContent")
search_result = json.loads(search_result)
# print(search_result)
return search_result
dict 형태의 문자열을 변경
반응형
'프로그래밍 > python' 카테고리의 다른 글
특정 작업 횟수마다 코드를 실행하는 팁 (0) | 2023.02.09 |
---|---|
변수 선언 시 타입 사용 (0) | 2023.02.08 |
python list의 맨 앞에 값 추가 (0) | 2023.02.06 |
파일 제거 (0) | 2023.02.03 |
파일명에 사용할 수 없는 문자 제거 (0) | 2023.02.02 |