I'm new to python (about 3 weeks). So I started learning bs4 and currently trying to tie "Xin lỗi! trang bạn tìm kiếm không tồn tại." of the HTML to a variable using bs4. I read the bs4 documentation and I got confused since english is not my primary language and also I haven't learn HTML..
<div class="title">Xin lỗi! trang bạn tìm kiếm không tồn tại.</div>
This is the coding from the source code I'm practicing on
I managed to find that part on html using the .find_all(class_="title")
and thankfully only one result came out which is the one above.
So what I'm trying to do is to verify if this specific string exist in the source code, then exit the program. My idea is to assign it to a variable and if =="Xin lỗi! trang bạn tìm kiếm không tồn tại." then exit program.
If you guys have simpler idea, please do share :)