How can I make this code more effective? [on hold]
<a href="#" class="tip" rel="
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
" 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
New contributor
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.
add a comment |
<a href="#" class="tip" rel="
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
" 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
New contributor
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
add a comment |
<a href="#" class="tip" rel="
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
" 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
New contributor
<a href="#" class="tip" rel="
Principal Name - S. BALKAR SINGH
Mobile No. - 8146611008
Email ID - gsssdhapaiasr@gmail.com
" 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
python web-scraping beautifulsoup
New contributor
New contributor
edited 3 mins ago
New contributor
asked 17 hours ago
vishnu preet
13
13
New contributor
New contributor
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
add a comment |
"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
add a comment |
0
active
oldest
votes
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
"This code works?" Did you test it?
– Mathias Ettinger
13 hours ago