I can find the element needed to be click using selenium. But the problem is the href attribute only contains part of the full link.
For example the website is https://vietstock.vn
The element is one of these:
pages = driver.find_elements("xpath", "//div[@class='owl-stage']//div[@class='single_post_text']")
Each element is something like this:
<a href="/2022/08/quy-dau-tu-tiep-tuc-giao-dich-tram-lang-3358-989801.htm" title="..." class="fontbold">Quỹ đầu tư tiếp tục giao dịch trầm lắng</a>
How can I click the link with full URL as https://vietstock.vn/2022/08/quy-dau-tu-tiep-tuc-giao-dich-tram-lang-3358-989801.htm
Well, after googling around, I found a solution for my own question. But honestly, I don't know the reason:
driver.execute_script("arguments[0].click();", element)
Which element is the element with href link I just extracted.
How to click a href which contains only a half of the full url using selenium python