jeudi 17 janvier 2019

How to retrieve Censor board rating element from IMDB page?

Hi I'm trying to build a webscraping tool for top 250 IMDB movies. However, When i try to retrieve censor board rating i'm not able to populate the result to some of the movies. Please help

I'm stuck at the point where I cannot fully import the censor board values.

moviePage=conn.urlopen("https://www.imdb.com/title/tt0071562/?pf_rd_m=A2FGELUUNOQJNL&pf_rd_p=e31d89dd-322d-4646-8962-327b42fe94b1&pf_rd_r=EW20N056WRP652WNA2K7&pf_rd_s=center-1&pf_rd_t=15506&pf_rd_i=top&ref_=chttp_tt_3") moviePage_soup = soup(moviePage, 'html.parser') tpList={} tbw=moviePage_soup.find('div',class_="title_bar_wrapper").find('div',class_="titleBar").find('div',class_="title_wrapper") rtgrd=tbw.find('div',class_='subtext').text tpList['Censor board rating']=rtgrd[1].strip()

I'm getting the exact result for some movies but in some movies I'm getting a whitespace. In the current scenario I should get R but the output is whitespace.




Aucun commentaire:

Enregistrer un commentaire