Question when extracting the src attribute value of the img tag with Python selenium, if the attribute value contains Korean

Asked 2 years ago, Updated 2 years ago, 44 views

When extracting the src attribute value of the img tag with Python selenium, if the attribute value contains Korean

Hangul is not displayed properly, and only the Korean part (image file name) is displayed as "%EB%A7%88%EC%BC%80%ED%8C%85%20%EB%A6%AC%ED%8F%..." (hereinafter omitted).

What should I do to make Hangul come out properly?

python selenium

2022-09-22 14:00

1 Answers

It is called URL encoding. You probably have to do something like this to decode it.

from urllib import parse

# I'm going to...

filename = parse.unquote (file name)


2022-09-22 14:00

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.