I am doing web scrapping and have done this so far-
page = requests.get('http://abcdefgh.in')
print(page.status_code)
soup = BeautifulSoup(page.content, 'html.parser')
all_p = soup.find_all(class_="p-list-sec")
print((all_p))
After doing this, I have something like this when I print all_p-
<div class = "p-list-sec">
<UI> <li> < a href = "link1", title = "tltle1">title1<a/></li>
<li> < a href = "link2", title = "tltle2">title2<a/></li>
<li> < a href = "link3", title = "tltle3">title3<a/></li>
</ui>
</div>
<div class = "p-list-sec">
<UI> <li> < a href = "link1", title = "tltle1">title1<a/></li>
<li> < a href = "link2", title = "tltle2">title2<a/></li>
<li> < a href = "link3", title = "tltle3">title3<a/></li>
</ui>
</div>
<div class = "p-list-sec">
<UI> <li> < a href = "link1", title = "tltle1">title1<a/></li>
<li> < a href = "link2", title = "tltle2">title2<a/></li>
<li> < a href = "link3", title = "tltle3">title3<a/></li>
</ui>
</div> and so on up to around 40 div classes.
Now I want to extract all the a href and title inside class p-list-sec and want to store them into file. I know how to store them into file but extracting all the a href and title from the all p-list-sec class is something which is creating issue for me. I am using python 3.9 and requests and beautifulsoup libraries in windows 10 using command prompt.
Thanks, akhi