Thank you for looking over my concern, I am a beginner with python web scrapping with bs4, and the code that I wrote using beautifulsoup is not returning the required paragraph.
import requests
from bs4 import BeautifulSoup as bs
def downloadUrl(link):
req = requests.get(link)
statusCode = req.status_code
if(statusCode==200):
return req.text
else:
return ('Did not connect :( status code {}'.format(statusCode))
def ParseText(html):
soupParser = bs(html,features="html.parser")
table = soupParser.select('div[class="_3xX726aBn29LDbsDtzr_6E._1Ap4F5maDtT1E1YuCiaO0r.D3IL3FD0RFy_mkKLPwL4"]')
txt = ''
for x in table:
txt+=(x.find('p').text)
return txt
link = input('Enter url')
print(ParseText(downloadUrl(link)))
the link I used is from Reddit Reddit link. The Paragraph I want it to return is this one.
How do I make programming interesting for children?
I'm 15 and I'm doing some volunteering work teaching programming to children (9-11 yrs). For the first few weeks we did some things with Scratch so they have at the very least a basic understanding of computing.
In my most recent lesson I introduced them to Python. We started off with the most basic but perhaps one of the most important programs "Hello, World!".
I offered an explanation for each part of the program like what print does, the content of the brackets, why we are using quotation marks etc.
I made sure to make it as simple as possible but the majority of the children didn't understand and I've noticed that when they don't understand they like to go off and do something else completely unrelated to the course.
Then I went onto input and that made it even more confusing.
My friend who is helping me was pretty adamant on not offering any explanation whatsoever because he thinks they wont understand but I really do want them getting engaged with programming.
There are around three people in my class who I believe have a genuine talent and interest in programming so I want to be able to generate that same interest amongst the others.
I try explaining why we need programming and I thought the idea of developing games and websites would interest them but that was futile.
Is there any way to make this more interesting for children or is does it just come naturally? Maybe I could have some learning resources
that make programming more enjoyable but also good for learning, like challenges or larger projects? Any help would be appreciated because I want them to have the same interest in programming that I do.
Aucun commentaire:
Enregistrer un commentaire