How can I make this code more effective? [on hold]












-2














<a href="#" class="tip" rel="&nbsp;
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
&nbsp;" style="user-select: text;">View Contact Details<span
class="caret"></span></a>


Principal name, mobile number and email id are the contents I'm interested in. When I specify soup.find('a', {'class':'tip'}) it gives me only "View Contact Details".



import requests
from bs4 import BeautifulSoup

headers = {'User-Agent': 'Mozilla/5.0'}

# form fields send to server
params = {
'SchoolType': '',
'Dist1': '',
'Sch1': '',
'SearchString': ''
}

r = requests.post('http://www.registration.pseb.ac.in/School/Schoollist',
headers=headers, data=params)

soup = BeautifulSoup(r.text, 'html.parser')

all_a = soup.find_all('a', {'class':'tip'})

for items in all_a:
print('text:', item.text)
print(' rel:', item['rel'])
print(' rel:', ' '.join(item['rel']))
print('-----')









share|improve this question









New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ 13 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.













  • "This code works?" Did you test it?
    – Mathias Ettinger
    13 hours ago
















-2














<a href="#" class="tip" rel="&nbsp;
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
&nbsp;" style="user-select: text;">View Contact Details<span
class="caret"></span></a>


Principal name, mobile number and email id are the contents I'm interested in. When I specify soup.find('a', {'class':'tip'}) it gives me only "View Contact Details".



import requests
from bs4 import BeautifulSoup

headers = {'User-Agent': 'Mozilla/5.0'}

# form fields send to server
params = {
'SchoolType': '',
'Dist1': '',
'Sch1': '',
'SearchString': ''
}

r = requests.post('http://www.registration.pseb.ac.in/School/Schoollist',
headers=headers, data=params)

soup = BeautifulSoup(r.text, 'html.parser')

all_a = soup.find_all('a', {'class':'tip'})

for items in all_a:
print('text:', item.text)
print(' rel:', item['rel'])
print(' rel:', ' '.join(item['rel']))
print('-----')









share|improve this question









New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











put on hold as off-topic by πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ 13 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.













  • "This code works?" Did you test it?
    – Mathias Ettinger
    13 hours ago














-2












-2








-2







<a href="#" class="tip" rel="&nbsp;
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
&nbsp;" style="user-select: text;">View Contact Details<span
class="caret"></span></a>


Principal name, mobile number and email id are the contents I'm interested in. When I specify soup.find('a', {'class':'tip'}) it gives me only "View Contact Details".



import requests
from bs4 import BeautifulSoup

headers = {'User-Agent': 'Mozilla/5.0'}

# form fields send to server
params = {
'SchoolType': '',
'Dist1': '',
'Sch1': '',
'SearchString': ''
}

r = requests.post('http://www.registration.pseb.ac.in/School/Schoollist',
headers=headers, data=params)

soup = BeautifulSoup(r.text, 'html.parser')

all_a = soup.find_all('a', {'class':'tip'})

for items in all_a:
print('text:', item.text)
print(' rel:', item['rel'])
print(' rel:', ' '.join(item['rel']))
print('-----')









share|improve this question









New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











<a href="#" class="tip" rel="&nbsp;
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
&nbsp;" style="user-select: text;">View Contact Details<span
class="caret"></span></a>


Principal name, mobile number and email id are the contents I'm interested in. When I specify soup.find('a', {'class':'tip'}) it gives me only "View Contact Details".



import requests
from bs4 import BeautifulSoup

headers = {'User-Agent': 'Mozilla/5.0'}

# form fields send to server
params = {
'SchoolType': '',
'Dist1': '',
'Sch1': '',
'SearchString': ''
}

r = requests.post('http://www.registration.pseb.ac.in/School/Schoollist',
headers=headers, data=params)

soup = BeautifulSoup(r.text, 'html.parser')

all_a = soup.find_all('a', {'class':'tip'})

for items in all_a:
print('text:', item.text)
print(' rel:', item['rel'])
print(' rel:', ' '.join(item['rel']))
print('-----')






python web-scraping beautifulsoup






share|improve this question









New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited 3 mins ago





















New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked 17 hours ago









vishnu preet

13




13




New contributor




vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






vishnu preet is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




put on hold as off-topic by πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ 13 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.




put on hold as off-topic by πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ 13 hours ago


This question appears to be off-topic. The users who voted to close gave this specific reason:


  • "Code not implemented or not working as intended: Code Review is a community where programmers peer-review your working code to address issues such as security, maintainability, performance, and scalability. We require that the code be working correctly, to the best of the author's knowledge, before proceeding with a review." – πάντα ῥεῖ, Heslacher, alecxe, 200_success, Sᴀᴍ Onᴇᴌᴀ

If this question can be reworded to fit the rules in the help center, please edit the question.












  • "This code works?" Did you test it?
    – Mathias Ettinger
    13 hours ago


















  • "This code works?" Did you test it?
    – Mathias Ettinger
    13 hours ago
















"This code works?" Did you test it?
– Mathias Ettinger
13 hours ago




"This code works?" Did you test it?
– Mathias Ettinger
13 hours ago










0






active

oldest

votes

















0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes

Popular posts from this blog

Costa Masnaga

Fotorealismo

Sidney Franklin