Beautifulsoup — извлечение jsname div с сайта Google classroom

#python #beautifulsoup

#python #beautifulsoup

Вопрос:

У меня есть много div, вложенных в следующий тег jsname div с несколькими разделами в том же формате без имени класса или идентификатора.:

 <div jsname="rymPhb">
  

Обычно с помощью beautifulsoap я мог бы анализировать divs с идентификатором или именем класса. С примером, показанным ниже..

 import requests
from bs4 import BeautifulSoup

URL = 'https://classroom.google.com/u/1/w/MTU4MjQxMDg5NFpa/tc/MTU4MzA0ODYwOTU3'
page = requests.get(URL)
soup = BeautifulSoup(page.content, 'html.parser')
idresults = soup.find(id='DivIDName')
print(idresults)
clasresults = soup.find(class_'DivClassName')
print(clasresults)
  

Возможно ли проанализировать данные, которые я ищу, с именем js? Вот как выглядит небольшая часть моего элемента в Google classroom?

 <div jsname="rymPhb"><div jsmodel="PTCFbe;dSSknb;xeYtDf;" data-include-stream-item-materials="false" data-include-submission-materials="false" data-has-focusable-child="" data-stream-item-id="158302656376" data-submission-id="2" data-stream-item-type="supplement" class=" jrhqBd LBlAUc Aopndd ZoT1D TIunU"><div class="xPAMbf boxOzd UISY8d-Ysl7Fe UvQypf" jsaction="click:YdzvGf" data-stream-item-id="158302656376"><a class="ptXozb" jsname="rQC7Ie" data-focusable-child="" aria-label="Material: amp;quot;First Day Jittersamp;quot;" href="/u/1/c/MTU4MjQxMDg5NFpa/m/MTU4MzAyNjU2Mzc2/details"></a><div class="oC328b WaqnWd bFjUmb-Wvd9Cc vUBwW m1PbN C2NJgb m1PbN"><div class="PazDv">Material</div><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H6V4h2v8l2.5-1.5L13 12V4h5v16z"></path></svg></div><div class="cQaDA"><div class="ToDHyd"><div class="Vlohie asQXV YVvGBb">Jordan Bonner posted a new material: First Day Jitters</div><div class="YzsI5e dDKhVc YVvGBb"><div jscontroller="pWi3Yd" jsaction="rcuQ6b:rcuQ6b;CPX6Je:rcuQ6b;wuANJc:rcuQ6b" class="YVvGBb YglcOe "></div></div></div><div class="Wd54if dDKhVc YVvGBb"></div></div><div class="k19Ou kpDQ8"><div jscontroller="bkcTxe" jsmodel="I8BbUd;PTCFbe" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;wuANJc:rcuQ6b;oquPK:rcuQ6b;wJx4ze:rcuQ6b;aWRkAb:N6Gb7c" data-hide-copy-link="false" data-hide-delete="false" data-show-bump="true" data-stream-item-id="158302656376" class=""><div jsshadow="" role="button" class="U26fgb JRtysb WzwrXb I12f0b K2mXPb" jscontroller="iSvg6e" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;keydown:I481le" jsname="LgbsSe" tabindex="0" aria-haspopup="true" aria-expanded="false" data-dynamic="true" data-alignright="true" aria-label="Material options"><div class="NWlf3e MbhUzd" jsname="ksKsZd"></div><span jsslot="" class="MhXXcc oJeWuf"><span class="Lw7GHd snByac"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"></path></svg></span></span></div></div></div><div jscontroller="By0w6" jsaction="mouseover:eGiyHb; click:eGiyHb; focus:eGiyHb; touchstart:eGiyHb" role="tooltip" tabindex="0" data-focus-id="Jd0Ule-158302656376" data-tooltip=" This material is visible to all teachers in this class. It will be permanently deleted tomorrow." class="a7OWub  iCRPId P354se"><span class="xSP5ic "><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"></path></svg></span><div class="PazDv" jsname="bOjMyf"> This material is visible to all teachers in this class. It will be permanently deleted tomorrow.</div></div></div><div class="SPoV1e"><div class="tmJXcf"><div class="yJz7Ve"><div class="stPFhf"><div class="hGxPcf"><div class="tmMkWb ppMo6b">Posted Sep 2</div></div></div></div></div><div jscontroller="AwTMWd" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;KtPeHe:rcuQ6b;IKzbTb:Yo3LPb;wuANJc:.CLIENT" data-parent-id="PTCFbe" data-mode="5" data-copies-only="false" data-single-thumbnail-list="false" data-show-originality-analyses="false" data-forms-only="false" jsmodel="PTCFbe" data-include-stream-item-materials="true" data-stream-item-id="158302656376" class="iz6wxe  fIXHld RDCsQc"><div class="FGTZvd" data-dom-id="cBxlDTBHLew-0-1-3-YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪4 minutes‬-amp;quot;First Day Jittersamp;quot; read-aloud-4 minutes$-false-false-false-false-$-https://www.youtube.com/watch?v=cBxlDTBHLew"><a class="VkhHKd e7EEH nQaZq" target="_blank" aria-label="Attachment: YouTube video: amp;quot;First Day Jittersamp;quot; read-aloud (4 minutes)" jsaction="LWntbc" href="https://www.youtube.com/watch?v=cBxlDTBHLew" data-focus-id="eTkQDe-https://www.youtube.com/watch?v=cBxlDTBHLew" jsname="HzV7m" data-dom-id="cBxlDTBHLew-0-1-3-YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪4 minutes‬-amp;quot;First Day Jittersamp;quot; read-aloud-4 minutes$-false-false-false-false-$-https://www.youtube.com/watch?v=cBxlDTBHLew"><div class="DAnlhb bFjUmb-Wvd9Cc"></div><div class="gM4mlb bFjUmb-Wvd9Cc"></div><div class="rzTfPe xSP5ic "><span class="DPvwYc" aria-hidden="true"></span></div><div class="lIHx8b YVvGBb asQXV ">"First Day Jitters" read-aloud</div></a><div class="pOf0gc QRiHXd Aopndd cKrCw" jsname="XgfUnd" jsaction="JIbuQc:Rsbfue(Rsbfue)"><a class="uqZtlf x0HGk QRiHXd MymH0d maXJsd" target="_blank" aria-label="Attachment: YouTube video: amp;quot;First Day Jittersamp;quot; read-aloud (4 minutes)" jsaction="LWntbc" href="https://www.youtube.com/watch?v=cBxlDTBHLew" title="amp;quot;First Day Jittersamp;quot; read-aloud" data-focus-id="hSRGPd-https://www.youtube.com/watch?v=cBxlDTBHLew"><div class="bxp7vf mAeA1"><img jsname="q4uQmd" jsaction="error:dyBsCf" src="https://i.ytimg.com/vi/cBxlDTBHLew/default.jpg" aria-hidden="true" data-mime-type=""><div class="S8qYve"><svg height="70px" width="105px" y="0px" x="0px" viewBox="0 0 105 70" enable-background="new 0 0 105 70"><g opacity=".5"><path d="m104.98 54.297c-0.017 0-0.017-54.297-0.017-54.297h-104.96v70h89.441s16.139-15.703 15.539-15.703z" fill="#E5E5E5"></path></g><polygon points="89.042 54.018 89.042 70 105 54.018" fill="#777"></polygon><g opacity=".702"><polygon points="73.084 70 89.042 70 89.042 54.018" fill="#bbb"></polygon></g></svg></div></div><div class="J5AvUe"><div class="A6dC2c bKJwEd VBEdtc-Wvd9Cc zZN2Lb-Wvd9Cc">"First Day Jitters" read-aloud</div><div class="cSyPgb cfaOwb"><div class="kRYv9b YVvGBb">YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪4 minutes‬</div></div></div></a><div class="PRmYNe QRiHXd" jsname="ncSfCe"></div></div></div></div></div><div role="region" jsname="EQPzXb" class="s2g3Xd SBOMqf"><div jscontroller="XGZuGb" jsmodel="xvu37b;I8BbUd;uJydvc;BCjFBc;" data-type="2" data-visibility="2" aria-expanded="false" data-stream-item-id="158302656376" class="PeGHgb Q8U8uc" jsaction="rcuQ6b:rcuQ6b;Ts0WYd:rcuQ6b;wJx4ze:rcuQ6b;uwjiC:rcuQ6b"><div class="WuChGe QRiHXd aHTZpf" jsname="tJHJj" jsaction="JIbuQc:jkaCtf"><span class="asQXV">1 class comment</span></div><div class="Ono85c VvAAB"><div class="dZVZab"><div jscontroller="dvgIje" jsaction="ym8qYd:u4pxTb" class="wJ76ge TIunU"><div class="QRiHXd pMq3Db"><img class="WqfsMd tkmmwb" aria-hidden="true" src="https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/s40-c-fbw=1/photo.jpg"><div class="G0rp"><div class="YU7iib"><div><a class="gJItbc asQXV" aria-label="Comment posted by Nicholas Santangelo">Nicholas Santangelo</a><span class="dDKhVc">Sep 11</span></div><div class="thiSD Gh0umc" jsaction="JIbuQc:pODwA(IgWJu)"><div class="KYmC8d kpDQ8 CG2qQ"><div jscontroller="RrRSXd" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;Ts0WYd:rcuQ6b;wJx4ze:rcuQ6b" jsmodel="I8BbUd" data-comment-id="155319534658"></div></div></div></div><div class="VSWCL tLDEHd"><html-blob><span class="NjE5zd">None of these books are in AR</span></html-blob></div></div></div></div></div></div><div jsname="uqYDP" class="oh9CFb Gh0umc kpDQ8 CMmBPd"><div jscontroller="bUQrJd" class="QRiHXd" jsaction="JIbuQc:npVELd(IgWJu);laiNib:H2nWWd"><div jsshadow="" role="button" class="uArJ5e cd29Sd UQuaGc kCyAyd vAguXd oxacD" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef" jsname="IgWJu" aria-disabled="false" tabindex="0" style="display: none;"><div class="Fvio9d MbhUzd" jsname="ksKsZd"></div><div class="e19J0b CeoRYc"></div><span jsslot="" class="l4V7wb Fxmcue cd29Sd"><span class="E6FpNe Ce1Y1c"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M16 10H6.83L9 7.83l1.41-1.41L9 5l-6 6 6 6 1.41-1.41L9 14.17 6.83 12H16c1.65 0 3 1.35 3 3v4h2v-4c0-2.76-2.24-5-5-5z"></path></svg></span><span class="NPEfkd RveJvd snByac">Reply</span></span></div><img class="Y0e1Gd tkmmwb" aria-hidden="true" src="https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/s40-c-fbw=1/photo.jpg" style=""><div data-has-focusable-child="" class="oleV8d cjzpkc-Wvd9Cc QRiHXd iJ6Xwe"><div class="x7VMf" jsaction="YqO5N:HRfSZd; keydown:Hq2uPe"><div jscontroller="HRRZwe" jsaction="rcuQ6b:rcuQ6b;RRPEYd:PqP2y; focus:wMnKwd" jsmodel="t1oSSc" data-role="owner,coteacher,student" data-include-invited="false" jsname="fKPC3" data-course-id="1582410894"><div class="O98Lj" style=""><div class="bswVrf Lzdwhd-BrZSOd" aria-hidden="true">Add class comment…</div><div id=":e.t" class="LsqTRb Lzdwhd-AyKMt tgNIJf-Wvd9Cc Yiql6e iTy5c editable" tabindex="0" role="textbox" aria-required="true" aria-multiline="true" aria-label="Add class comment…" data-focusable-child="" g_editable="true" contenteditable="plaintext-only"></div></div></div></div><div class="BNHE9c QRiHXd" jsaction="JIbuQc:sFeBqf(M2UYVd)"><div jsshadow="" role="button" class="uArJ5e Y5FYJe cjq2Db OZ6W0d ipGJ5d RDPZE" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef" jsname="M2UYVd" aria-label="Post" aria-disabled="true" tabindex="-1" data-tooltip="Post" data-focusable-child="" data-tooltip-vertical-offset="-12" data-tooltip-horizontal-offset="0"><div class="PDXc1b MbhUzd" jsname="ksKsZd"></div><span jsslot="" class="XuQwKc"><span class="GmuOkf"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M2 3v18l20-9L2 3zm2 11l9-2-9-2V6.09L17.13 12 4 17.91V14z"></path></svg></span></span></div></div></div></div></div></div></div></div><div jsmodel="PTCFbe;dSSknb;xeYtDf;" data-include-stream-item-materials="false" data-include-submission-materials="false" data-has-focusable-child="" data-stream-item-id="158303603864" data-submission-id="2" data-stream-item-type="supplement" class=" jrhqBd LBlAUc Aopndd ZoT1D TIunU"><div class="xPAMbf boxOzd UISY8d-Ysl7Fe UvQypf" jsaction="click:YdzvGf" data-stream-item-id="158303603864"><a class="ptXozb" jsname="rQC7Ie" data-focusable-child="" aria-label="Material: amp;quot;Wemberly Worriedamp;quot;" href="/u/1/c/MTU4MjQxMDg5NFpa/m/MTU4MzAzNjAzODY0/details"></a><div class="oC328b WaqnWd bFjUmb-Wvd9Cc vUBwW m1PbN C2NJgb m1PbN"><div class="PazDv">Material</div><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H6V4h2v8l2.5-1.5L13 12V4h5v16z"></path></svg></div><div class="cQaDA"><div class="ToDHyd"><div class="Vlohie asQXV YVvGBb">Jordan Bonner posted a new material: Wemberly Worried</div><div class="YzsI5e dDKhVc YVvGBb"><div jscontroller="pWi3Yd" jsaction="rcuQ6b:rcuQ6b;CPX6Je:rcuQ6b;wuANJc:rcuQ6b" class="YVvGBb YglcOe "></div></div></div><div class="Wd54if dDKhVc YVvGBb"></div></div><div class="k19Ou kpDQ8" data-guided-help-id="streamItemActionMenuGH"><div jscontroller="bkcTxe" jsmodel="I8BbUd;PTCFbe" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;wuANJc:rcuQ6b;oquPK:rcuQ6b;wJx4ze:rcuQ6b;aWRkAb:N6Gb7c" data-hide-copy-link="false" data-hide-delete="false" data-show-bump="true" data-stream-item-id="158303603864" class=""><div jsshadow="" role="button" class="U26fgb JRtysb WzwrXb I12f0b K2mXPb" jscontroller="iSvg6e" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;keydown:I481le" jsname="LgbsSe" tabindex="0" aria-haspopup="true" aria-expanded="false" data-dynamic="true" data-alignright="true" aria-label="Material options"><div class="NWlf3e MbhUzd" jsname="ksKsZd"></div><span jsslot="" class="MhXXcc oJeWuf"><span class="Lw7GHd snByac"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"></path></svg></span></span></div></div></div><div jscontroller="By0w6" jsaction="mouseover:eGiyHb; click:eGiyHb; focus:eGiyHb; touchstart:eGiyHb" role="tooltip" tabindex="0" data-focus-id="Jd0Ule-158303603864" data-tooltip=" This material is visible to all teachers in this class. It will be permanently deleted tomorrow." class="a7OWub  iCRPId P354se"><span class="xSP5ic "><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"></path></svg></span><div class="PazDv" jsname="bOjMyf"> This material is visible to all teachers in this class. It will be permanently deleted tomorrow.</div></div></div><div class="SPoV1e"><div class="tmJXcf"><div class="yJz7Ve"><div class="stPFhf"><div class="hGxPcf"><div class="tmMkWb ppMo6b">Posted Sep 2</div></div></div></div></div><div jscontroller="AwTMWd" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;KtPeHe:rcuQ6b;IKzbTb:Yo3LPb;wuANJc:.CLIENT" data-parent-id="PTCFbe" data-mode="5" data-copies-only="false" data-single-thumbnail-list="false" data-show-originality-analyses="false" data-forms-only="false" jsmodel="PTCFbe" data-include-stream-item-materials="true" data-stream-item-id="158303603864" class="iz6wxe  fIXHld RDCsQc"><div class="FGTZvd" data-dom-id="TG-fizttWOs-0-1-3-YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪7 minutes‬-Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena-7 minutes$-false-false-false-false-$-https://www.youtube.com/watch?v=TG-fizttWOs"><a class="VkhHKd e7EEH nQaZq" target="_blank" aria-label="Attachment: YouTube video: Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena (7 minutes)" jsaction="LWntbc" href="https://www.youtube.com/watch?v=TG-fizttWOs" data-focus-id="eTkQDe-https://www.youtube.com/watch?v=TG-fizttWOs" jsname="HzV7m" data-dom-id="TG-fizttWOs-0-1-3-YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪7 minutes‬-Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena-7 minutes$-false-false-false-false-$-https://www.youtube.com/watch?v=TG-fizttWOs"><div class="DAnlhb bFjUmb-Wvd9Cc"></div><div class="gM4mlb bFjUmb-Wvd9Cc"></div><div class="rzTfPe xSP5ic "><span class="DPvwYc" aria-hidden="true"></span></div><div class="lIHx8b YVvGBb asQXV ">Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena</div></a><div class="pOf0gc QRiHXd Aopndd cKrCw" jsname="XgfUnd" jsaction="JIbuQc:Rsbfue(Rsbfue)"><a class="uqZtlf x0HGk QRiHXd MymH0d maXJsd" target="_blank" aria-label="Attachment: YouTube video: Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena (7 minutes)" jsaction="LWntbc" href="https://www.youtube.com/watch?v=TG-fizttWOs" title="Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena" data-focus-id="hSRGPd-https://www.youtube.com/watch?v=TG-fizttWOs"><div class="bxp7vf mAeA1"><img jsname="q4uQmd" jsaction="error:dyBsCf" src="https://i.ytimg.com/vi/TG-fizttWOs/default.jpg" aria-hidden="true" data-mime-type=""><div class="S8qYve"><svg height="70px" width="105px" y="0px" x="0px" viewBox="0 0 105 70" enable-background="new 0 0 105 70"><g opacity=".5"><path d="m104.98 54.297c-0.017 0-0.017-54.297-0.017-54.297h-104.96v70h89.441s16.139-15.703 15.539-15.703z" fill="#E5E5E5"></path></g><polygon points="89.042 54.018 89.042 70 105 54.018" fill="#777"></polygon><g opacity=".702"><polygon points="73.084 70 89.042 70 89.042 54.018" fill="#bbb"></polygon></g></svg></div></div><div class="J5AvUe"><div class="A6dC2c bKJwEd VBEdtc-Wvd9Cc zZN2Lb-Wvd9Cc">Wemberly Worried by Kevin Henkes - Children's Books Read Aloud | Storytime with Elena</div><div class="cSyPgb cfaOwb"><div class="kRYv9b YVvGBb">YouTube videoamp;nbsp;amp;nbsp;amp;nbsp;‪7 minutes‬</div></div></div></a><div class="PRmYNe QRiHXd" jsname="ncSfCe"></div></div></div></div></div><div role="region" jsname="EQPzXb" class="s2g3Xd SBOMqf"><div jscontroller="XGZuGb" jsmodel="xvu37b;I8BbUd;uJydvc;BCjFBc;" data-type="2" data-visibility="2" aria-expanded="false" data-stream-item-id="158303603864" class="PeGHgb" jsaction="rcuQ6b:rcuQ6b;Ts0WYd:rcuQ6b;wJx4ze:rcuQ6b;uwjiC:rcuQ6b"><div class="WuChGe QRiHXd aHTZpf" jsname="tJHJj" jsaction="JIbuQc:jkaCtf"><span class="asQXV">No class comments</span></div><div class="Ono85c VvAAB"></div><div jsname="uqYDP" class="oh9CFb Gh0umc kpDQ8 CMmBPd"><div jscontroller="bUQrJd" class="QRiHXd" jsaction="JIbuQc:npVELd(IgWJu);laiNib:H2nWWd"><div jsshadow="" role="button" class="uArJ5e cd29Sd UQuaGc kCyAyd vAguXd oxacD" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef" jsname="IgWJu" aria-disabled="false" tabindex="0" style="display: none;"><div class="Fvio9d MbhUzd" jsname="ksKsZd"></div><div class="e19J0b CeoRYc"></div><span jsslot="" class="l4V7wb Fxmcue cd29Sd"><span class="E6FpNe Ce1Y1c"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M16 10H6.83L9 7.83l1.41-1.41L9 5l-6 6 6 6 1.41-1.41L9 14.17 6.83 12H16c1.65 0 3 1.35 3 3v4h2v-4c0-2.76-2.24-5-5-5z"></path></svg></span><span class="NPEfkd RveJvd snByac">Reply</span></span></div><img class="Y0e1Gd tkmmwb" aria-hidden="true" src="https://lh3.googleusercontent.com/-XdUIqdMkCWA/AAAAAAAAAAI/AAAAAAAAAAA/4252rscbv5M/s40-c-fbw=1/photo.jpg" style=""><div data-has-focusable-child="" class="oleV8d cjzpkc-Wvd9Cc QRiHXd iJ6Xwe"><div class="x7VMf" jsaction="YqO5N:HRfSZd; keydown:Hq2uPe"><div jscontroller="HRRZwe" jsaction="rcuQ6b:rcuQ6b;RRPEYd:PqP2y; focus:wMnKwd" jsmodel="t1oSSc" data-role="owner,coteacher,student" data-include-invited="false" jsname="fKPC3" data-course-id="1582410894"><div class="O98Lj" style=""><div class="bswVrf Lzdwhd-BrZSOd" aria-hidden="true">Add class comment…</div><div id=":f.t" class="LsqTRb Lzdwhd-AyKMt tgNIJf-Wvd9Cc Yiql6e iTy5c editable" tabindex="0" role="textbox" aria-required="true" aria-multiline="true" aria-label="Add class comment…" data-focusable-child="" g_editable="true" contenteditable="plaintext-only"></div></div></div></div><div class="BNHE9c QRiHXd" jsaction="JIbuQc:sFeBqf(M2UYVd)"><div jsshadow="" role="button" class="uArJ5e Y5FYJe cjq2Db OZ6W0d ipGJ5d RDPZE" jscontroller="VXdfxd" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef" jsname="M2UYVd" aria-label="Post" aria-disabled="true" tabindex="-1" data-tooltip="Post" data-focusable-child="" data-tooltip-vertical-offset="-12" data-tooltip-horizontal-offset="0"><div class="PDXc1b MbhUzd" jsname="ksKsZd"></div><span jsslot="" class="XuQwKc"><span class="GmuOkf"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M2 3v18l20-9L2 3zm2 11l9-2-9-2V6.09L17.13 12 4 17.91V14z"></path></svg></span></span></div></div></div></div></div></div></div></div><div jsmodel="PTCFbe;dSSknb;xeYtDf;" data-include-stream-item-materials="false" data-include-submission-materials="false" data-has-focusable-child="" data-stream-item-id="158302656334" data-submission-id="2" data-stream-item-type="supplement" class=" jrhqBd LBlAUc Aopndd ZoT1D TIunU"><div class="xPAMbf boxOzd UISY8d-Ysl7Fe UvQypf" jsaction="click:YdzvGf" data-stream-item-id="158302656334"><a class="ptXozb" jsname="rQC7Ie" data-focusable-child="" aria-label="Material: amp;quot;Diffendoofer Dayamp;quot;" href="/u/1/c/MTU4MjQxMDg5NFpa/m/MTU4MzAyNjU2MzM0/details"></a><div class="oC328b WaqnWd bFjUmb-Wvd9Cc vUBwW m1PbN C2NJgb m1PbN"><div class="PazDv">Material</div><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M18 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm0 18H6V4h2v8l2.5-1.5L13 12V4h5v16z"></path></svg></div><div class="cQaDA"><div class="ToDHyd"><div class="Vlohie asQXV YVvGBb">Jordan Bonner posted a new material: Diffendoofer Day</div><div class="YzsI5e dDKhVc YVvGBb"><div jscontroller="pWi3Yd" jsaction="rcuQ6b:rcuQ6b;CPX6Je:rcuQ6b;wuANJc:rcuQ6b" class="YVvGBb YglcOe "></div></div></div><div class="Wd54if dDKhVc YVvGBb"></div></div><div class="k19Ou kpDQ8" data-guided-help-id="streamItemActionMenuGH"><div jscontroller="bkcTxe" jsmodel="I8BbUd;PTCFbe" jsaction="rcuQ6b:rcuQ6b;uwjiC:rcuQ6b;wuANJc:rcuQ6b;oquPK:rcuQ6b;wJx4ze:rcuQ6b;aWRkAb:N6Gb7c" data-hide-copy-link="false" data-hide-delete="false" data-show-bump="true" data-stream-item-id="158302656334" class=""><div jsshadow="" role="button" class="U26fgb JRtysb WzwrXb I12f0b K2mXPb" jscontroller="iSvg6e" jsaction="click:cOuCgd; mousedown:UX7yZ; mouseup:lbsD7e; mouseenter:tfO1Yc; mouseleave:JywGue; focus:AHmuwe; blur:O22p3e; contextmenu:mg9Pef;touchstart:p6p2H; touchmove:FwuNnf; touchend:yfqBxc(preventMouseEvents=true|preventDefault=true); touchcancel:JMtRjd;keydown:I481le" jsname="LgbsSe" tabindex="0" aria-haspopup="true" aria-expanded="false" data-dynamic="true" data-alignright="true" aria-label="Material options"><div class="NWlf3e MbhUzd" jsname="ksKsZd"></div><span jsslot="" class="MhXXcc oJeWuf"><span class="Lw7GHd snByac"><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M"><path d="M12 8c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2zm0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2z"></path></svg></span></span></div></div></div><div jscontroller="By0w6" jsaction="mouseover:eGiyHb; click:eGiyHb; focus:eGiyHb; touchstart:eGiyHb" role="tooltip" tabindex="0" data-focus-id="Jd0Ule-158302656334" data-tooltip=" This material is visible to all teachers in this class. It will be permanently deleted in 9 days." class="a7OWub  iCRPId P354se"><span class="xSP5ic "><svg focusable="false" width="24" height="24" viewBox="0 0 24 24" class=" NMm5M hhikbc"><path d="M11 18h2v-2h-2v2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8zm0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4z"></path></svg></span><div class="PazDv" jsname="bOjMyf"> This material is visible to all teachers in this class. It will be permanently deleted in 9 days.</div></div></div><div class="SPoV1e"><div class="tmJXcf"><div class="yJz7Ve"><div class="stPFhf"><div class="hGxPcf"><div class="tmMkWb ppMo6b">Posted Sep 2</div></div></div></div></div><div jscontroller="AwTMWd" 
  

Я попытался использовать класс div в формате, подобном следующему:

YzsI5e dDKhVc YVvGBb

Однако каждый синтаксический анализ возвращается с None. Я не понимаю, что я делаю неправильно.

Комментарии:

1. При доступе к странице отображается «Тема не найдена». повторно проверьте права доступа к ссылке / доступу

2. Я не уверен, что это возможно, поскольку это класс Google, для которого требуется доступ. Я включил элемент, который я ищу. jsname div = rymPhb

Ответ №1:

Вы можете получить такое div использование jsname :

 div = soup.find('div', jsname = "rymPhb")
  

Затем вы можете найти все, что хотите, под div тегом. Надеюсь, что это поможет!

Комментарии:

1. Спасибо, что поддержали мои ответы! Скромная просьба с моей стороны. Не могли бы вы, пожалуйста, принять мои ответы как лучшие ответы?