主頁 > 區塊鏈 > 使用Beautifulsoup從保存在文本檔案中的html資料中提取內容

使用Beautifulsoup從保存在文本檔案中的html資料中提取內容

2021-10-17 20:29:56 區塊鏈

我努力地從本地桌面上以.txt格式保存的HTML檔案中提取一些內容。

在此輸入圖片描述

我的目標是提取所有綠色文本的src、姓名、標題和介紹。

示例 html 資料:

< div _ngcontent-tbp-c85="" class="ng-tns-c85-14 ng-star-inserted" /span>> < div _ngcontent-tbp-c85=""/span> class="ng-tns-c85-14"> < app-profile-card _ngcontent-tbp-c85="" _nghost-tbp- c82="" class="ng-tns-c82-4511 ng-tns-c85-14 ng-star-inserted" > <! ---->< div _ngcontent-tbp-c82="" data-test="selectProfileCard" class="card overflow-visible word-wrap selectedProfile ng-tns-c82-4511 ng-star-inserted" > <! ----><! ---->< div _ngcontent-tbp-c82="" class="card-content padding-half-bottom ng-tns-c82-4511 ng-star-inserted"/span>> < div _ngcontent-tbp-c82=""/span> class="content ng-tns-c82-4511"/span>> < article _ngcontent-tbp-c82=""/span> class="media ng-tns-c82-4511"> < figure _ngcontent-tbp-c82="" class="media-left hidden-xs hidden-sm ng-tns-c82-4511"> < p _ngcontent-tbp-c82="" placement="top" class="cursor-pointer ng-tns-c82-4511"> < img _ngcontent-tbp-c82="" onerror="this. one rror=null; this.src='https://d304g80if9nu2q.cloudfront.net/grip/static_web_images/image_placeholder. png'" alt=" class="profile-image ng-tns-c82-4511 ng-star-inserted" src="https: //d1ew4vee5tqwao. cloudfront.net/things-images/67af0c730dc0c1266c3758fb1213d73f_1630606676.jpeg"><!----><! ----></p></figure>< div _ngcontent-tbp-c82="" class="媒體內容是相對的ng-tns-c82-4511"> < div _ngcontent-tbp-c82="" class="col-xs-12 padding--none hidden-lg hidden-md center-everything ng-tns-c82-4511" > < div _ngcontent-tbp-c82="" class="has-text-centered is-fullwidth ng-tns-c82-4511"> < div _ngcontent-tbp-c82="" class="col-xs-12 padding--none center-everything ng-tns-c82-4511"/span>> < div _ngcontent-tbp-c82="" placement="top" class="cursor-pointer margin-bottom ng-tns-c82-4511"> < img _ngcontent-tbp-c82="" onerror="this. one rror=null; this.src='https://d304g80if9nu2q.cloudfront.net/grip/static_web_images/image_placeholder. png'" alt=" class="profile-image ng-tns-c82-4511 ng-star-inserted" src="https: //d1ew4vee5tqwao. cloudfront.net/things-images/67af0c730dc0c1266c3758fb1213d73f_1630606676.jpeg"><!----><! ----></div></div><。 a _ngcontent-tbp-c82="" apptextcolor="" class="link-is-positive ng-tns-c82-4511" style="color: rgb(0, 46, 225);"> Tori Combs </a><! ----><! ----><! ----><! ---->< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" /span>> < small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" > 1100展位</small>< ! ---->< small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted"> -</small>/span><! ---->< small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" > 贊助商</small>/span><! ----><! ----><! ----></p><! ---->< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" /span>> < small _ngcontent-tbp-c82=""/span> class="ng-tns-c82-4511"/span>> Louisville, KY</small></p>< ! ---->< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" /span>>  GhostDraft的市場經理 </p><! ---->< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" /span>> < span _ngcontent-tbp-c82="" placement="top"  data- test="inPersonTag" class="標簽 cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted"> < img _ngcontent-tbp-c82="" src="assets/icons/hybrid-in-person. svg" style="margin-right:
   8px;" class="ng-tns-c82-4511"> 當面</span>/span><! ---->< span _ngcontent-tbp-c82="" placement="top"  data-test="virtualTag" class="標簽 cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted" > < img _ngcontent-tbp-c82="" src="assets/icons/hybrid-virtual. svg" style="margin-right: 8px;" class="ng-tns-c82-4511"> 虛擬</span>/span><! ----></p><! ----> <! ----><! ----></div></div><。 div _ngcontent-tbp-c82="" class="hidden-xs hidden-sm margin-half-bottom ng-tns-c82-4511"/span>>。 <! ---->< div _ngcontent-tbp-c82="" class=" headline-padding ng-tns-c82-4511" /span>> < a _ngcontent-tbp-c82="" placement="top"  class="ng-tns-c82-4511 link-is-positive"  data- test="thingId5380205" style="color: rgb(0, 46, 225);">Tori Combs </a>< span _ngcontent-tbp-c82="" class="margin-half-bottom ng-tns-c82-4511 ng-star-inserted"/span>>。 < small _ngcontent-tbp-c82=""/span> class="ng-tns-c82-4511"> &nbsp;Booth 1100</small> </span>/span><! ----><! ----><! ----><! ----><! ----><! ----><! ----></div>< div _ngcontent-tbp-c82=""/span> class="ng-tns-c82-4511"/span>> <! ---->< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 margin--none ng-star-inserted" >  GhostDraft的市場經理 </p><! ---->< p _ngcontent-tbp-c82=""/span> class="margin-none-bottom ng-tns-c82-4511 ng-star-inserted" style="margin-top: 0. 2rem;">< span _ngcontent-tbp-c82="" placement=top" data- test="inPersonTag" class="標簽 cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted"> < img _ngcontent-tbp-c82="" src="assets/icons/hybrid-in-person. svg" alt=" style="margin-right: 8px;" class="ng-tns-c82-4511"> 當面</span>/span><! ---->< span _ngcontent-tbp-c82="" placement="top"  data-test="virtualTag" class="標簽 cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted" > < img _ngcontent-tbp-c82="" src="assets/icons/hybrid-virtual. svg" alt=" style="margin-right: 8px;" class="ng-tns-c82-4511"> 虛擬</span>/span><! ----></p><! ----> <! ----></div><! ----></div>< /div></article> < div _ngcontent-tbp-c82="" class="gray-divider padding-half-top padding-half-bottom ng-tns-c82-4511 cursor-pointer ng-star-inserted"/span>> < p _ngcontent-tbp-c82="" class="summary-text margin-none ng-tns-c82-4511"> 摘要</p>< p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted" /span>> 我是GhostDraft的市場經理,這是一個領先的客戶溝通和數字體驗平臺,旨在幫助運營商簡化li</p>< ! ----><! ----></div>< ! ---->< div _ngcontent-tbp-c82="" class="gray-divider is-relative is-flex xalign-center margin-bottom ng-tns-c82-4511 cursor-pointer ng-star-inserted" > < div _ngcontent-tbp-c82="" class="arrow-button center-everything ng-tns-c82-4511 ng-star-inserted"/span>>。 < img _ngcontent-tbp-c82="" src="htps: //d304g80if9nu2q. cloudfront.net/grip/static_web_images/nav_arrow_down. png" alt=" class="ng-tns-c82-4511"> </div>/span><! ----></div><! ---->< app-profile-actions _ngcontent-tbp-c82="" _nghost- tbp-c81="" class="ng-tns-c82-4511 ng-star-inserted" > <! ----><! ----><! ---->< div _ngcontent-tbp-c81="" class="action-container card-actions is-fullwidth padding-half-bottom"/span>>。 <! ---->< div _ngcontent-tbp-c81="" class=" is-flex is-relative ng-star-inserted" > < div _ngcontent-tbp-c81="" class="rec-action is-flex padding-none" > < a _ngcontent-tbp-c81="" appbackgroundhover10=" class="text is-1 link interested is-joined-right" data-test="thingYetToSwipeInterested 5380205" style="border-color:
   rgb(0, 46, 225);">< app-handshake _ngcontent-tbp-c81="" class=" center-everything"> <svg xmlns="http: //www. w3. org/2000/svg" height="20" width="24" viewBox="0 0 30 25"> < g fill="none" fill-rule="evenodd"> < path appSvgStrokeColor="" stroke-lineecap="square" d="M9。 5 2. 5l5 4" style="stroke: rgb(0, 46, 225);"></path> < path appSvgPathColor=""/span> d="M23. 544 17.31l-5.128 5.126a1.41 1.41 0 0 1-1.004.416c-.38 0-.736-.147-1.004-.416l-.796-.795-.812-.812-7.128-.127-. 813-.812-4.235-4.233L8.66 2.624L2.47 2.47.191.19.258.087 2.102.7.01.003-3.1 3.098A2.236 2.236 0 0-.569 2.181C.099 .365.283.711.569.998A2.242 2.242 0 0 0 1.59.658C.575 0 1.15-.219 1.59-.658L2.395-2.394A1.425 1.425 0 0 1 2.016 0L3.747 3.745.812.812.804.804C.55 .55.55 1.441 0 1.991zm-10.352 5.126a1.408 1.408 0 0 1-1.004.416 1.41 1.41 0 0 1-1.004-.416l-5.128-5.127a1.41 1.41 0 0 1 0-1.991l.803-.804 7.129 7.127-.796.795zm4.83-17.065L.258- .086.19-.192 2.471-2.47 6.035 6.034-4.236 4.233-3.85-3.85A2.43 2.43 0 0-3.434 0L-2.499 2.5A1.098 1.098 0 1-1.555-1.555L3.404-3.404.209-.209.726-.24.179-. 369-.123 1.733-.578zm5.53 8.33L28.6 8.658 20.941 1L-3.283 3.281-2.826.942-2.891-.942L8.659 1 1 8.657L5.046 5.045-.802.804C-1.998-1 2.617 0 3.615L5.128 5.128C.502 .5 1.159.751 1.816.751S1.315-.25 1.816-.751L.796-.796.796C.5 .5 1.158.751 1.816.751.657 0 1.314-.25 1.816-.751l5.128-5.128a2.557 2.557 0 0 0-3.615l-.804-。 804z" style="fill: rgb(0, 46, 225);"></path> </g> </svg></app-handshake> <。 span _ngcontent-tbp-c81="" apptextcolor="" class="normal-show" style="color: rgb(0, 46, 225);">顯示興趣</span> </a>< a _ngcontent-tbp-c81="" appbackgroundhover10=" class="swipe-message-button is-joined-left is-relative center-everything ng-star-inserted" style="min-width: 39px; border-left: 0px rgb(0, 46, 225); border-top-color: rgb(0, 46, 225); border-right-color: rgb(0, 46, 225); border-bottom-color: rgb(0, 46, 225);" data-test="showSwipeMenu5380205"> < app-swipe-message-arrow _ngcontent-tbp-c81="" class=" center-everything arrow-down" > < svg id="swipe-intro-arrow" xmlns="http: //www. w3. org/2000/svg" height="16" width="16" viewBox="0 0 98 98" appSvgPathColor=" style="fill: rgb(0, 46, 225);">< path stroke-width="6" d="M34。 9,15.8a3,3,0,0,0-4.2. 1,2.9,2.9,0,0,0,0,4.2L60.8,49,30.7,77.9a2.9,2.9,0,0,0,0,4.2,2.7,2.7,0,0,0,2.1.9,3.2,3.2,0,0,0,2.1-.8l32.4-31a3.1,3.1,0,0,0,0-4. 4Z"></path></svg>/span><。 /app-swipe-message-arrow></a><! ----></div>/span><! ----></div><! ----><! ----><! ---->< div _ngcontent-tbp-c81="" class="rec-action is-line-block padding-none primary-style alt-hover is-hoverable is-relative ng-star-inserted"> < a _ngcontent-tbp-c81="" appbackgroundcolor=" class="text is-1 link normal-show"/span> data-test="thingMeeting5380205" style="background-color: rgb(0, 46, 225);">< app-calendar-white _ngcontent-tbp-c81="" class=" center-everything"> < svg width="19px"/span> height="21px"/span> viewBox="0 0 19 21"/span> version="1. 1"/span> xmlns="http://www.w3.org/2000/svg"/span> xmlns:xlink="http://www.w3. org/1999/xlink">< g id="Page-1" stroke="none" stroke- width="1" fill="none" fill-rule=" evenodd" /span>> <g id="Lists" transform="translate(-793. 000000, -845. 000000)" fill="#FFFFFF">< g id="Test" transform="translate(271. 000000, 400. 000000)">< g id="會議" transform="translate(508. 000000, 438. 000000)">< g id="Group-10" transform="translate(14。 000000, 7. 000000)"><path d="M12.285,4。 13641172 C12.285,4.36088587 12.1182369,4.54758055 11.9098513,4.58629697 L11.83,4.59366391 C11.5787104,4.59366391 11.375,4.39627992 11.375,4.13641172 L11.375,2。 85933429 L10.465,2.85933429 L10.464,2.858 L11.374,2.858 L11.375,0.457252188 C11.375,0.232778046 11.5417631,0.0460833659 11.7501487,0.00736694494 L11.83,0 C12. 0812896,0 12.285,0.197383996 12.285,0.457252188 L12.284,2.858 L13.194,2.858 L13.195,1.83746556 L16.6613828,1.83746556 C17.0693522,1.83746556 17.4606346,1.99942571
   17.7492564,2.28775965 C18.0378472,2.57606262 18.2,2.96725815 18.2,3.37518368 L18.2,18.8152651 C18.2,19.1975106 18.0358425,19.5613489 17.7492564,19.8142917 C17.4587993,20.0706512 17. 0847242,20.2121212 16.6973156,20.2121212 L1.44687579,20.2121212 C1.07006292,20.2121212 0.707100039,20.0700656 0.430391385,19.8142917 C0.156014499,19.5606733 -2.00529097e-14,19。 2040068 -1.77635684e-14,18.8303692 L-1.77635684e-14,3.36095141 C-1.78125285e-14,2.96116197 0.15415672,2.57676831 0.430391385,2.28775965 C0.705285375,2.00015367 1.08583134,1.83746556 1。 48368044,1.83746556 L5.005,1.83746556 L5.004,2.858 L1.80876543,2.85827977 C1.38185185,2.85827977 0.91,3.33680168 0.91,3.76567017 L0.91,7.91131007 L17.087,7.911 L17.0877778, 3. 76567017 C17.0877778,3.33680168 16.6159259,2.85827977 16.1890123,2.85827977 L13.194,2.858 L13.195,2.85933429 L12.285,2.85933429 L12.285,4.13641172 Z M17.0898006,7.91131007 L17. 087,7.911 l17.087,8.83 l0.91,8.83004285 l0.91,18.3070414 l0.91,18.3070414 c0.91,18.9375244 1.40209611,19.191307 1.80876543,19.191307 l16.1890123,19.191307 l16.1890123,19.191307 c16. 5371471,19.191307 17.0877778,18.9016241 17.0877778,18.3070414 L17.087,8.83 L17.0898006,8.83004285 L17.0898006,7.91131007 Z M6.37,0 C6.62128956,0 6.825,0.197383996 6.825,0.457252188 L6. 824,2.858 L7.734,2.858 L7.735,1.83746556 L10.465,1.83746556 L10.464,2.858 L7.734,2.858 L7.735,2.85933429 L6.825,2.85933429 L6.825,4.13641172 C6.825,4.36088587 6.65823688,4.54758055 6. 44985125,4.58629697 L6.37,4.59366391 C6.11871044,4.59366391 5.915,4.39627992 5.915,4.13641172 L5.915,2.85933429 L5.005,2。 85933429 l5.004,2.858 l5.914,2.858 l5.915,0.457252188 c5.915,0.232778046 6.08176312,0.0460833659 6.29014875,0.00736694494 l6. 37,0 Z" id="Combined-Shape-Copy-3"><。 /path></g> < /g></g></g>。 </g> </svg> </app-calendar-white>< span _ngcontent-tbp-c81="">Request a meeting< /span>< img _ngcontent-tbp-c81="" src="assets/icons/chevron-white. svg" alt="" class="is-hidden-mobile margin--none arrow-down" > </a> < a _ngcontent-tbp-c81=""/span> appbackgroundhover75="" class="text is-1 link hover-show" style="background-color: rgb(0, 46, 225);">< app-calendar-white _ngcontent-tbp-c81="" class=" center-everything"> < svg width="19px"/span> height="21px"/span> viewBox="0 0 19 21"/span> version="1. 1"/span> xmlns="http://www.w3.org/2000/svg"/span> xmlns:xlink="http://www.w3. org/1999/xlink">< g id="Page-1" stroke="none" stroke- width="1" fill="none" fill-rule=" evenodd" /span>> <g id="Lists" transform="translate(-793. 000000, -845. 000000)" fill="#FFFFFF">< g id="Test" transform="translate(271. 000000, 400. 000000)">< g id="會議" transform="translate(508. 000000, 438. 000000)">< g id="Group-10" transform="translate(14。 000000, 7.000000)"><path d="M12.285,4.13641172 C12.285,4.36088587 12.1182369, 4.54758055 11. 9098513,4.58629697 L11.83,4.59366391 C11.5787104,4.59366391 11.375,4.39627992 11.375,4.13641172 L11.375,2。 85933429 l10.465,2.85933429 l10.464,2.858 l11.374,2.858 l11.375,0.457252188 c11.375,0.232778046 11.5417631,0. 0460833659 11.7501487,0.00736694494 L11.83,0 C12.0812896,0 12.285,0.197383996 12.285,0.457252188 L12.284,2.858 L13. 194,2.858 L13.195,1.83746556 L16.6613828,1.83746556 C17.0693522,1.83746556 17.4606346,1.99942571 17.7492564,2。 28775965 C18.0378472,2.57606262 18.2,2.96725815 18.2,3.37518368 L18.2,18.8152651 C18.2,19.1975106 18.0358425,19。 5613489 17.7492564,19.8142917 C17.4587993,20.0706512 17.0847242,20.2121212 16.6973156,20.2121212 L1.44687579,20。 2121212 C1.07006292,20.2121212 0.707100039,20.0700656 0.430391385,19.8142917 C0.156014499,19.5606733 -2.00529097e-14,19.2040068 -1.77635684e-14,18.8303692 L-1.77635684e-14,3.36095141 C-1.78125285e-14,2.96116197 0.15415672,2。 57676831 0.430391385,2.28775965 C0.705285375,2.00015367 1.08583134,1.83746556 1.48368044,1.83746556 L5.005,1。 83746556 l5.004,2.858 l1.80876543,2.85827977 c1.38185185,2.85827977 0.91,3.33680168 0.91,3.76567017 l0.91,7. 91131007 L17.087,7.911 L17.0877778,3.76567017 C17.0877778,3.33680168 16.6159259,2.85827977 16.1890123,2。 85827977 L13.194,2.858 L13.195,2.85933429 L12.285,2.85933429 L12.285,4.13641172 Z M17.0898006,7.91131007 L17.087,7。 911 L17.087,8.83 L0.91,8.83004285 L0.91,18.3070414 L0.91,18.3070414 C0.91,18.9375244 1.40209611,19.191307 1. 80876543,19.191307 L16.1890123,19.191307 L16.1890123,19.191307 C16.5371471,19.191307 17.0877778,18.9016241 17. 0877778,18.3070414 L17.087,8.83 L17.0898006,8.83004285 L17.0898006,7.91131007 Z M6.37,0 C6.62128956,0 6.825,0.197383996 6.825,0.457252188 L6. 824,2.858 L7.734,2.858 L7.735,1.83746556 L10.465,1.83746556 L10.464,2.858 L7.734,2.858 L7.735,2.85933429 L6.825,2.85933429 L6.825,4.13641172 C6. 825,4.36088587 6.65823688,4.54758055 6.44985125,4.58629697 L6.37,4.59366391 C6.11871044,4.59366391 5.915,4.39627992 5.915,4.13641172 L5.915,2。 85933429 l5.005,2.85933429 l5.004,2.858 l5.914,2.858 l5.915,0.457252188 c5.915,0.232778046 6.08176312,0.0460833659 6.29014875,0.00736694494 l6. 37,0 Z" id="Combined-Shape-Copy-3">< /path></g> < /g></g></g>。 </g> </svg> </app-calendar-white>< span _ngcontent-tbp-c81="">Request a meeting< /span>< img _ngcontent-tbp-c81="" src="assets/icons/chevron-white. svg" alt="" class="is-hidden-mobile margin--none arrow-down" > </a>/span><! ----></div><! ----> <! ---->< div _ngcontent-tbp-c81=""/span> class="rec-action skip is-line-block padding--none skip-corner ng-star-inserted" data-test="skipThing5380205"> < a _ngcontent-tbp-c81="" class="text is-1 link is-overable skip"> < svg _ngcontent-tbp-c81="" xmlns="http: //www. w3. org/2000/svg" height="20" width="20" viewBox="0 0 22 22" class="normal-show"> < path _ngcontent-tbp-c81="" fill="none" fill-rule="evenodd" stroke="#59566B" stroke-width=" 。 92" d="M11 21.46C5.223 21.46.54 16.777.54 11 。 54 5.223 5.223.54 11 .54 16.777.54 21.46 5.223 21.46 11C0 5.777-4.683 10.46-10.46 10.46zm-.05-10.035L3.26 3.26A.035 .035 0 1 1 .05-.05L-6.47-6.47A.035.035 0 0 1-.05.05L3.21 3.21-3.21 3.21A.035.035 0 1 .05.05L6.47-6.47A.035 .035 0 1 1-.05-.05l-3.26 3. 26z"></path></svg><。 svg _ngcontent-tbp-c81=""/span> xmlns="http: //www. w3. org/2000/svg" height="20" width="20" viewBox="0 0 22 22" class="hover-show"> < path _ngcontent-tbp-c81="" fill="none" fill-rule="evenodd" appSvgStrokeColor=" stroke-width=". 92" d="M11 21.46C5.223 21.46.54 16.777.54 11 。 54 5.223 5.223.54 11 .54 16.777.54 21.46 5.223 21.46 11C0 5.777-4.683 10.46-10.46 10.46zm-.05-10.035L3.26 3.26A.035 .035 0 1 1 .05-.05L-6.47-6.47A.035.035 0 0 1-.05.05L3.21 3.21-3.21 3.21A.035.035 0 1 .05.05L6.47-6.47A.035 .035 0 1 1-.05-.05L-3.26 3.26z" style="stroke:
   rgb(0, 46, 225);"></path> </svg>< span _ngcontent-tbp-c81=""/span> class="normal-show"/span>> Skip< /span>< span _ngcontent-tbp-c81="" apptextcolor="" class="hover-show" style="color: rgb(0, 46, 225);">Skip</span>< /a></div><! ----><! ----><! ----><! ----></div></app-file-actions><! ----><! ----></div></div>< ! ----><! ----></div><! ----></app-profile-card><! ----></div>/span></div

以下是我能夠提取的代碼:

photo = soup.find(attrs={"class": "profile-image ng-tns-c82-4511 ng-star-inserted"/span>})
name = soup.find(attrs={"class": "link-is-positive ng-tns-c82-4511"/span>})
title = soup.find(attrs={"class": "ng-tns-c82-4511 margin--none ng-star-inserted"/span>})
intro = soup.find_all(attrs={"class": "summary-text margin--none ng-tns-c82-4511"/span>})

然而,提取代碼的介紹不起作用。有什么方法可以為所有需要的內容提取干凈的文本嗎?

感謝您的任何想法!

。謝謝你!

uj5u.com熱心網友回復:

嘗試:

from bs4 import BeautifulSoup

html_doc = ""
<div _ngcontent-tbp-c85="" class="ng-tns-c85-14 ng-star-inserted"><div _ngcontent-tbp-c85="" class="ng-tns-c85-14"><app-file-card _ngcontent-tbp-c85=" _nghost-tbp-c82="" class="ng-tns-c82-4511 ng-tns-c85-14 ng-star-inserted"><!----><div _ngcontent-tbp-c82="" data-test="selectProfileCard" class="card overflow-visible word-wrap selectedProfile ng-tns-c82-4511 ng-star-inserted"><----> <! ----><div _ngcontent-tbp-c82="" class="card-content padding-half-bottom ng-tns-c82-4511 ng-star-inserted"><div _ngcontent-tbp-c82="" class="content ng-tns-c82-4511"><文章 _ngcontent-tbp-c82=" class="media ng-tns-c82-4511">。 <圖 _ngcontent-tbp-c82="" class="media-left hidden-xs hidden-sm ng-tns-c82-4511"><p _ngcontent-tbp-c82=" placement="top" class="cursor-pointer ng-tns-c82-4511"><img _ngcontent-tbp-c82=" one rror="this. one rror=null; this.src='https://d304g80if9nu2q.cloudfront. net/grip/static_web_images/image_placeholder.png'" alt="" class="profile-image ng-tns-c82-4511 ng-star-inserted" src="https://d1ew4vee5tqwao.cloudfront.net/things-images/67af0c730dc0c1266c3758fb1213d73f_1630606676.jpeg"><!----><! ----></p></figure><div _ngcontent-tbp-c82="" class="media-content is-relative ng-tns-c82-4511">< div _ngcontent-tbp-c82="" class="col-xs-12 padding--none hidden-lg hidden-md center-everything ng-tns-c82-4511"><div _ngcontent-tbp-c82="" class="has-text-centered is-fullwidth ng-tns-c82-4511"> <div _ngcontent-tbp-c82="" class="col-xs-12 padding--none center-everything ng-tns-c82-4511"><div _ngcontent-tbp-c82="" placement="top" class="cursor-pointer margin-bottom ng-tns-c82-4511"><img _ngcontent-tbp-c82=" one rror="this. one rror=null; this.src='https://d304g80if9nu2q.cloudfront.net/grip/static_web_images/image_placeholder.png'" alt="" class="個人資料-圖片 ng-tns-c82-4511 ng-star-inserted" src="https://d1ew4vee5tqwao.cloudfront. net/things-images/67af0c730dc0c1266c3758fb1213d73f_1630606676.jpeg"><!----><! ----></div></div><a _ngcontent-tbp-c82="" apptextcolor="" class="link-is-positive ng-tns-c82-4511" style="color: rgb(0, 46, 225);"> Tori Combs < /a><! ----><!----><!----><!----><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted"><small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted">Booth 1100</small><! ----><small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted">?</small><! ----><small _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted">Sponsor</small><!----><!----><!----></p><! ----><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted"><small _ngcontent-tbp-c82="" class="ng-tns-c82-4511">Louisville, KY</small></p><! ----><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted"> GhostDraft的市場經理</p><! ----><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted">< span _ngcontent-tbp-c82=" place="top" data-test="inPersonTag" class="tag cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted"><img _ngcontent-tbp-c82=" src="assets/icons/hybrid-in-person. svg" style="margin-right: 8px;" class="ng-tns-c82-4511"> In-person </span>< ! ----><span _ngcontent-tbp-c82=" place="top" data-test="virtualTag" class="tag cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted">< img _ngcontent-tbp-c82=" src="assets/icons/hybrid-virtual. svg" style="margin-right: 8px;" class="ng-tns-c82-4511"> 虛擬</span><!----></p><!----><! ----></div></div><div _ngcontent-tbp-c82="" class="hidden-xs hidden-sm margin-half-bottom ng-tns-c82-4511" ><! ----><div _ngcontent-tbp-c82="" class="headline-padding ng-tns-c82-4511"><a _ngcontent-tbp-c82=" place="top" class="ng-tns-c82-4511 link-is-positive" data-test="thingId5380205" style="color: rgb(0, 46, 225);"> Tori Combs </a><span _ngcontent-tbp-c82="" class="margin-half-bottom ng-tns-c82-4511 ng-star-inserted" > <small _ngcontent-tbp-c82="" class="ng-tns-c82-4511">&nbsp;Booth 1100</small></span><! ----><!----><!----><!----><!----><!----><!----></div><div _ngcontent-tbp-c82="" class="ng-tns-c82-4511"><! ----><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 margin--none ng-star-inserted"> GhostDraft的市場經理</p><! ----><p _ngcontent-tbp-c82="" class="margin-none-bottom ng-tns-c82-4511 ng-star-inserted" style="margin-top: 0. 2rem;"><span _ngcontent-tbp-c82="" placement="top" data-test="inPersonTag" class="tag cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted"><img _ngcontent-tbp-c82=" src="assets/icons/hybrid-in-person. svg" alt="" style="margin-right: 8px;" class="ng-tns-c82-4511"> In-person </span>< ! ----><span _ngcontent-tbp-c82=" place="top" data-test="virtualTag" class="tag cursor-pointer agenda-label margin-quarter-right ng-tns-c82-4511 ng-star-inserted">< img _ngcontent-tbp-c82=" src="assets/icons/hybrid-virtual. svg" alt="" style="margin-right: 8px;" class="ng-tns-c82-4511"> 虛擬</span><!----></p><!----></div>< ! ----></div></div></article><div _ngcontent-tbp-c82="" class="gray-divider padding-half-top padding-half-bottom ng-tns-c82-4511 cursor-pointer ng-star-inserted" > <p _ngcontent-tbp-c82="" class="summary-text margin--none ng-tns-c82-4511" > 摘要</p><p _ngcontent-tbp-c82="" class="ng-tns-c82-4511 ng-star-inserted">我是GhostDraft的市場經理,這是一個領先的客戶溝通和數字體驗平臺,旨在幫助運營商簡化li</p><! ----><!----></div><! ----><div _ngcontent-tbp-c82="" class="gray-divider is-relative is-flex xalign-center margin-bottom ng-tns-c82-4511 cursor-pointer ng-star-inserted" > <div _ngcontent-tbp-c82="" class="arrow-button center-everything ng-tns-c82-4511 ng-star-inserted"><img _ngcontent-tbp-c82=" src="https: //d304g80if9nu2q. cloudfront.net/grip/static_web_images/nav_arrow_down.png" alt="" class="ng-tns-c82-4511"></div><!----></div><!----><app-file-actions _ngcontent-tbp-c82=" _nghost-tbp-c81="" class="ng-tns-c82-4511 ng-star-inserted"><!----><!----><!----><div _ngcontent-tbp-c81="" class="action-container card-actions is-fullwidth padding-half--bottom"><! ----><div _ngcontent-tbp-c81="" class="is-flex is-relative ng-star-inserted"><div _ngcontent-tbp-c81=" class="rec-action is-flex padding-none"><。 a _ngcontent-tbp-c81="" appbackgroundhover10="" class="text is-1 link interested is-joined-right" data-test="thingYetToSwipeInterested5380205" style="border-color: rgb(0, 46, 225);"><app-handshake _ngcontent-tbp-c81=" " class="center-everything"><svg xmlns="http://www. w3.org/2000/svg" height="20" width="24" viewBox="0 0 30 25"><g fill="none" fill-rule="evenodd"><path appSvgStrokeColor="" strok-lineecap=" square" d="M9. 5 2.5l5 4" style="stroke: rgb(0, 46, 225);"></path><path appSvgPathColor=" " d="M23. 544 17.31l-5.128 5.126a1.41 1.41 0 0 1-1.004.416c-.38 0-.736-.147-1.004-.416l-.796-.795-.812-.812-7.128-.127-. 813-.812-4.235-4.233L8.66 2.624L2.47 2.47.191.19.258.087 2.102.7.01.003-3.1 3.098A2.236 2.236 0 0-.569 2.181C.099 .365.283.711.569.998A2.242 2.242 0 0 0 1.59.658C.575 0 1.15-.219 1.59-.658L2.395-2.394A1.425 1.425 0 0 1 2.016 0L3.747 3.745.812.812.804.804C.55 .55.55 1.441 0 1.991zm-10.352 5.126a1.408 1.408 0 0 1-1.004.416 1.41 1.41 0 0 1-1.004-.416l-5.128-5.127a1.41 1.41 0 0 1 0-1.991l.803-.804 7.129 7.127-.796.795zm4.83-17.065 l.258- .086.19-.192 2.471-2.47 6.035 6.034-4.236 4.233-3.85-3.85A2.43 2.43 0 0-3.434 0L-2.499 2.5A1.098 1.098 0 1-1.555-1.555L3.404-3.404.209-.209.726-.24.179-. 369-.123 1.733-.578zm5.53 8.33L28.6 8.658 20.941 1L-3.283 3.281-2.826.942-2.891-.942L8.659 1 1 8.657L5.046 5.045-.802.804C-1.998-1 2.617 0 3.615L5.128 5.128C.502 .5 1.159.751 1.816.751S1.315-.25 1.816-.751L.796-.796.796C.5 .5 1.158.751 1.816.751.657 0 1.314-.25 1.816-.751l5.128-5.128a2.557 2.557 0 0 0-3.615l-.804-。 804z" style="fill: rgb(0, 46, 225);"></path></g></svg></app-handshake><span _ngcontent-tbp-c81=" " apptextcolor=" " class="normal-show" style="color: rgb(0, 46, 225);">顯示興趣</span></a><a _ngcontent-tbp-c81=" " appbackgroundhover10=" " class="swipe-message-button is-joined-left is-relative center-everything ng-star-inserted" style="min-width: 39px; border-left: 0px rgb(0, 46, 225); border-top-color: rgb(0, 46, 225); border-right-color: rgb(0, 46, 225); border-bottom-color: rgb(0, 46, 225);" data-test="showSwipeMenu5380205"><app-swipe-message-arrow _ngcontent-tbp-c81="" class="center-everything arrow-down" ><svg id="swipe-intro-arrow" xmlns="http://www. w3.org/2000/svg" height="16" width="16" viewBox="0 0 98 98" x="0px" y="0px" appSvgPathColor="" style="fill: rgb(0, 46, 225);"><path strok-width="6" d="M34.9,15.8a3,3,0, 0-4.2.1, 2.9, 2。 9,0,0,0,0,4.2L60.8,49,30.7,77.9a2.9,2.9,0,0,0,0,4.2,2.7,2.7,0,0,0,2.1.9,3.2,3.2,0,0,0,2.1-.8l32.4-31a3.1,3.1,0,0,0,0-4.4Z"></path></svg></app-swipe-message-arrow></a><! ----></div><!----></div><!----><!----><!----><! ----><div _ngcontent-tbp-c81="" class="rec-action is-line-block padding--none primary-style alt-hover is-hoverable is-relative ng-star-inserted"><a _ngcontent-tbp-c81=" appbackgroundcolor=" class="text is-1 link normal-show" data-test="thingMeeting5380205" style="background-color: rgb(0, 46, 225);"><app-calendar-white _ngcontent-tbp-c81="" class="center-everything"><svg width="19px" height="21px" viewBox="0 0 19 21" version="1. 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www. w3.org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Lists" transform="translate(-793. 000000, -845.000000)" fill="#FFFFFF"><g id="測驗" transform="translate(271.000000, 400.000000)"><g id="會議" transform="translate(508. 000000, 438.000000)"><g id="Group-10" transform="translate(14.000000, 7.000000)"><path d="M12.285,4.13641172 C12.285,4.36088587 12.1182369, 4. 54758055 11.9098513,4.58629697 L11.83,4.59366391 C11.5787104,4.59366391 11.375,4.39627992 11.375,4.13641172 L11.375,2.85933429 L10.465,2.85933429 L10. 464,2.858 L11.374,2.858 L11.375,0.457252188 C11.375,0.232778046 11.5417631,0.0460833659 11.7501487,0.00736694494 L11.83,0 C12.0812896,0 12.285,0。 197383996 12.285,0.457252188 L12.284,2.858 L13.194,2.858 L13.195,1.83746556 L16.6613828,1.83746556 C17.0693522,1.83746556 17.4606346,1.99942571 17.7492564,2。 28775965 C18.0378472,2.57606262 18.2,2.96725815 18.2,3.37518368 L18.2,18.8152651 C18.2,19.1975106 18.0358425,19.5613489 17.7492564,19.8142917 C17.4587993,20。 0706512 17.0847242,20.2121212 16.6973156,20.2121212 L1.44687579,20.2121212 C1.07006292,20.2121212 0.707100039,20.0700656 0.430391385,19.8142917 C0. 156014499,19.5606733 -2.00529097e-14,19.2040068 -1.77635684e-14,18.8303692 L-1.77635684e-14, 3.36095141 C-1.78125285e-14,2.96116197 0.15415672, 2.57676831 0. 430391385,2.28775965 C0.705285375,2.00015367 1.08583134,1.83746556 1.48368044,1.83746556 l5.005,1.83746556 l5.004,2.858 l1.80876543,2.85827977 C1. 38185185,2.85827977 0.91,3.33680168 0.91,3.76567017 L0.91,7.91131007 L17.087,7.911 L17.0877778,3.76567017 C17.0877778,3.33680168 16.6159259,2.85827977 16. 1890123,2.85827977 L13.194,2.858 L13.195,2.85933429 L12.285,2.85933429 L12.285,4.13641172 Z M17.0898006,7.91131007 L17.087,7.911 L17.087,8.83 L0.91,8. 83004285 L0.91,18.3070414 L0.91,18.3070414 C0.91,18.9375244 1.40209611,19.191307 1.80876543,19.191307 L16.1890123,19.191307 L16.1890123,19.191307 C16. 5371471,19.191307 17.0877778,18.9016241 17.0877778,18.3070414 L17.087,8.83 L17.0898006,8.83004285 L17.0898006,7.91131007 Z M6.37,0 C6.62128956,0 6.825,0。 197383996 6.825,0.457252188 L6.824,2.858 L7.734,2.858 L7.735,1.83746556 L10.465,1.83746556 L10.464,2.858 L7.734,2.858 L7.735,2.85933429 L6.825,2。 85933429 L6.825,4.13641172 C6.825,4.36088587 6.65823688,4.54758055 6.44985125,4.58629697 L6.37,4.59366391 C6.11871044,4.59366391 5.915,4.39627992 5.915,4。 13641172 l5.915,2.85933429 l5.005,2.85933429 l5.004,2.858 l5.914,2.858 l5.915,0.457252188 c5.915,0.232778046 6.08176312,0.0460833659 6.29014875,0.00736694494 l6. 37,0 Z" id="Combined-Shape-Copy-3"></path></g></g></g></svg></app-calendar-white>。 <span _ngcontent-tbp-c81="">請求開會</span><img _ngcontent-tbp-c81="" src="assets/icons/chevron-white. svg" alt="" class="is-hidden-mobile margin--none arrow-down"></a><a _ngcontent-tbp-c81=" " appbackgroundhover75="" class="text is-1 link hover-show" style="background-color:
   rgb(0, 46, 225);"><app-calendar-white _ngcontent-tbp-c81=" " class="center-everything"><svg width="19px" height="21px" viewBox="0 0 19 21" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3. org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="Lists" transform="translate(-793.000000, -845.000000)" fill="#FFFFFF"><g id="Test" transform="translate(271.000000, 400. 000000)"><g id="會議" transform="translate(508.000000, 438.000000)"><g id="第10組" transform="translate(14.000000, 7.000000)"><path d="M12.285,4.13641172 C12.285,4.36088587 12.1182369, 4.54758055 11.9098513, 4.58629697 L11. 83,4.59366391 C11.5787104,4.59366391 11.375,4.39627992 11.375,4.13641172 L11.375,2.85933429 L10.465,2.85933429 L10.464,2。 858 L11.374,2.858 L11.375,0.457252188 C11.375,0.232778046 11.5417631,0.0460833659 11.7501487,0.00736694494 L11.83,0 C12. 0812896,0 12.285,0.197383996 12.285,0.457252188 L12.284,2.858 L13.194,2.858 L13.195,1.83746556 L16.6613828,1。 83746556 C17.0693522,1.83746556 17.4606346,1.99942571 17.7492564,2.28775965 C18.0378472,2.57606262 18.2,2.96725815 18.2,3. 37518368 L18.2,18.8152651 C18.2,19.1975106 18.0358425,19.5613489 17.7492564,19.8142917 C17.4587993, 20.0706512 17.0847242, 20. 2121212 16.6973156,20.2121212 L1.44687579,20.2121212 C1.07006292,20.2121212 0.707100039,20.0700656 0.430391385,19。 8142917 C0.156014499,19.5606733 -2.00529097e-14,19.2040068 -1.77635684e-14,18.8303692 L-1.77635684e-14,3.36095141 C-1。 78125285e-14,2.96116197 0.15415672,2.57676831 0.430391385,2.28775965 C0.705285375,2.00015367 1.08583134,1.83746556 1. 48368044,1.83746556 L5.005,1.83746556 L5.004,2.858 L1.80876543,2.85827977 C1.38185185,2.85827977 0.91,3.33680168 0.91,3。 76567017 L0.91,7.91131007 L17.087,7.911 L17.0877778,3.76567017 C17.0877778,3.33680168 16.6159259,2.85827977 16.1890123,2。 85827977 L13.194,2.858 L13.195,2.85933429 L12.285,2.85933429 L12.285,4.13641172 Z M17.0898006,7.91131007 L17. 087,7.911 L17.087,8.83 L0.91,8.83004285 L0.91,18.3070414 C0.91,18.9375244 1.40209611,19.191307 1. 80876543,19.191307 L16.1890123,19.191307 L16.1890123,19.191307 C16.5371471,19.191307 17.0877778,18.9016241 17.0877778,18。 3070414 L17.087,8.83 L17.0898006,8.83004285 L17.0898006,7.91131007 Z M6.37,0 C6.62128956,0 6.825,0.197383996 6. 825,0.457252188 L6.824,2.858 L7.734,2.858 L7.735,1.83746556 L10.465,1.83746556 L10.464,2.858 L7.734,2.858 L7. 735,2.85933429 L6.825,2.85933429 L6.825,4.13641172 C6.825,4.36088587 6.65823688,4.54758055 6.44985125,4.58629697 L6. 37,4.59366391 C6.11871044,4.59366391 5.915,4.39627992 5.915,4.13641172 L5.915,2.85933429 L5.005,2.85933429 L5. 004,2.858 l5.914,2.858 l5.915,0.457252188 c5.915,0.232778046 6.08176312,0.0460833659 6.29014875,0.00736694494 l6. 37,0 Z" id="Combined-Shape-Copy-3"></path></g></g></g></svg></app-calendar-white> <span _ngcontent-tbp-c81="">請求開會</span><img _ngcontent-tbp-c81="" src="assets/icons/chevron-white. svg" alt="" class="is-hidden-mobile margin--none arrow-down"></a><!----></div><!----><! ----><div _ngcontent-tbp-c81="" class="rec-action skip is-line-block padding--none skip-corner ng-star-inserted" data-test="skipThing5380205"><a _ngcontent-tbp-c81="" class="text is-1 link is-hoverable skip"><;svg _ngcontent-tbp-c81=" xmlns="http://www.w3. org/2000/svg" height="20" width="20" viewBox="0 0 22 22" class="normal-show"><path _ngcontent-tbp-c81="" fill="none" fill-rule="evenodd" stroke="#59566B" strok-width=". 92" d="M11 21.46C5.223 21.46.54 16.777.54 11 .54 5.223 5.223.54 11 .54 16.777.54 21.46 5.223 21.46 11c0 5.777-4.683 10.46-10.46 10.46zm-.05-10.035l3.26 3.26a.035 .035 0 1 1 .05-.05L-6.47-6.47A.035.035 0 0 1-.05.05L3.21 3.21-3.21 3.21A.035.035 0 1 .05.05L6.47-6.47A.035 .035 0 1 1-.05-.05L-3.26 3.26z"></path></svg><svg _ngcontent-tbp-c81="" xmlns="http://www.w3. org/2000/svg" height="20" width="20" viewBox="0 0 22 22" class="hover-show"><path _ngcontent-tbp-c81="" fill="none" fill-rule="evenodd" appSvgStrokeColor="" stroke-width=" 。 92" d="M11 21.46C5.223 21.46.54 16.777.54 11 .54 5.223 5.223.54 11 .54 16.777.54 21.46 5.223 21.46 11c0 5.777-4.683 10.46-10.46 10.46zm-.05-10.035l3.26 3.26a.035 .035 0 1 1 .05-.05L-6.47-6.47A.035.035 0 0 1-.05.05L3.21 3.21-3.21 3.21A.035 .035 0 0 1 .05.05L6.47-6.47A.035 .035 0 1 1-.05-.05l-3.26 3. 26z" style="stroke: rgb(0, 46, 225);"></path></svg><span _ngcontent-tbp-c81="" class="normal-show"> Skip</span><span _ngcontent-tbp-c81=" apptextcolor=" class="hover-show" style="color: rgb(0, 46, 225);">Skip</span></a></div>< ! ----><!----><!----><!----><!----></div></app-profile-actions><!----><! ----></div></div><!----><!----></div><!----></app-profile-card><!----></div></div>
"""

soup = BeautifulSoup(html_doc, "html.parser")

photo = soup.select_one(".profile-image") ["src"]
name = soup.select_one("app-profile-card a")
# I'm assuming every title is in form "<some position> AT <some company>" :
title = soup.select_one('p:-soup-contains(" at ") ')
intro = soup.select_one('p:-soup-contains(" Summary")   p')

print(Photo)
print(name.get_text(strip=True)
print(title.get_text(strip=True)
print(intro.get_text(strip=True)

列印:

https://d1ew4vee5tqwao.cloudfront.net/things-images/67af0c730dc0c1266c3758fb1213d73f_1630606676.jpeg
Tori Combs
GhostDraft的市場經理
我是GhostDraft的市場經理,GhostDraft是一個領先的客戶溝通和數字體驗平臺,旨在幫助運營商精簡利弊。

編輯:不帶CSS選擇器的版本:

photo = soup.select_one(".profile-image") ["src"]
name = soup.select_one("app-profile-card a")
# I'm assuming every title is in form "<some position> AT <some company>" :
title = soup.find(lambda tag: tag.name == "p" and " at"  in tag.text)
intro = soup.find(
    lambda tag: tag.name == "p" and " summary"  in tag.text
).find_next_sibling("p"/span>)

轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/320245.html

標籤:

上一篇:不能用pd.read_html來搜刮整個表格

下一篇:在Python中獲取貨運指數的資料

標籤雲
其他(157675) Python(38076) JavaScript(25376) Java(17977) C(15215) 區塊鏈(8255) C#(7972) AI(7469) 爪哇(7425) MySQL(7132) html(6777) 基礎類(6313) sql(6102) 熊猫(6058) PHP(5869) 数组(5741) R(5409) Linux(5327) 反应(5209) 腳本語言(PerlPython)(5129) 非技術區(4971) Android(4554) 数据框(4311) css(4259) 节点.js(4032) C語言(3288) json(3245) 列表(3129) 扑(3119) C++語言(3117) 安卓(2998) 打字稿(2995) VBA(2789) Java相關(2746) 疑難問題(2699) 细绳(2522) 單片機工控(2479) iOS(2429) ASP.NET(2402) MongoDB(2323) 麻木的(2285) 正则表达式(2254) 字典(2211) 循环(2198) 迅速(2185) 擅长(2169) 镖(2155) 功能(1967) .NET技术(1958) Web開發(1951) python-3.x(1918) HtmlCss(1915) 弹簧靴(1913) C++(1909) xml(1889) PostgreSQL(1872) .NETCore(1853) 谷歌表格(1846) Unity3D(1843) for循环(1842)

熱門瀏覽
  • JAVA使用 web3j 進行token轉賬

    最近新學習了下區塊鏈這方面的知識,所學不多,給大家分享下。 # 1. 關于web3j web3j是一個高度模塊化,反應性,型別安全的Java和Android庫,用于與智能合約配合并與以太坊網路上的客戶端(節點)集成。 # 2. 準備作業 jdk版本1.8 引入maven <dependency> < ......

    uj5u.com 2020-09-10 03:03:06 more
  • 以太坊智能合約開發框架Truffle

    前言 部署智能合約有多種方式,命令列的瀏覽器的渠道都有,但往往跟我們程式員的風格不太相符,因為我們習慣了在IDE里寫了代碼然后打包運行看效果。 雖然現在IDE中已經存在了Solidity插件,可以撰寫智能合約,但是部署智能合約卻要另走他路,沒辦法進行一個快捷的部署與測驗。 如果團隊管理的區塊節點多、 ......

    uj5u.com 2020-09-10 03:03:12 more
  • 谷歌二次驗證碼成為區塊鏈專用安全碼,你怎么看?

    前言 谷歌身份驗證器,前些年大家都比較陌生,但隨著國內互聯網安全的加強,它越來越多地出現在大家的視野中。 比較廣泛接觸的人群是國際3A游戲愛好者,游戲盜號現象嚴重+國外賬號安全應用廣泛,這類游戲一般都會要求用戶系結名為“兩步驗證”、“雙重驗證”等,平臺一般都推薦用谷歌身份驗證器。 后來區塊鏈業務風靡 ......

    uj5u.com 2020-09-10 03:03:17 more
  • 密碼學DAY1

    目錄 ##1.1 密碼學基本概念 密碼在我們的生活中有著重要的作用,那么密碼究竟來自何方,為何會產生呢? 密碼學是網路安全、資訊安全、區塊鏈等產品的基礎,常見的非對稱加密、對稱加密、散列函式等,都屬于密碼學范疇。 密碼學有數千年的歷史,從最開始的替換法到如今的非對稱加密演算法,經歷了古典密碼學,近代密 ......

    uj5u.com 2020-09-10 03:03:50 more
  • 密碼學DAY1_02

    目錄 ##1.1 ASCII編碼 ASCII(American Standard Code for Information Interchange,美國資訊交換標準代碼)是基于拉丁字母的一套電腦編碼系統,主要用于顯示現代英語和其他西歐語言。它是現今最通用的單位元組編碼系統,并等同于國際標準ISO/IE ......

    uj5u.com 2020-09-10 03:04:50 more
  • 密碼學DAY2

    ##1.1 加密模式 加密模式:https://docs.oracle.com/javase/8/docs/api/javax/crypto/Cipher.html ECB ECB : Electronic codebook, 電子密碼本. 需要加密的訊息按照塊密碼的塊大小被分為數個塊,并對每個塊進 ......

    uj5u.com 2020-09-10 03:05:42 more
  • NTP時鐘服務器的特點(京準電子)

    NTP時鐘服務器的特點(京準電子) NTP時鐘服務器的特點(京準電子) 京準電子官V——ahjzsz 首先對時間同步進行了背景介紹,然后討論了不同的時間同步網路技術,最后指出了建立全球或區域時間同步網存在的問題。 一、概 述 在通信領域,“同步”概念是指頻率的同步,即網路各個節點的時鐘頻率和相位同步 ......

    uj5u.com 2020-09-10 03:05:47 more
  • 標準化考場時鐘同步系統推進智能化校園建設

    標準化考場時鐘同步系統推進智能化校園建設 標準化考場時鐘同步系統推進智能化校園建設 安徽京準電子科技官微——ahjzsz 一、背景概述隨著教育事業的快速發展,學校建設如雨后春筍,隨之而來的學校教育、管理、安全方面的問題成了學校管理人員面臨的最大的挑戰,這些問題同時也是學生家長所擔心的。為了讓學生有更 ......

    uj5u.com 2020-09-10 03:05:51 more
  • 位元幣入門

    引言 位元幣基本結構 位元幣基礎知識 1)哈希演算法 2)非對稱加密技術 3)數字簽名 4)MerkleTree 5)哪有位元幣,有的是UTXO 6)位元幣挖礦與共識 7)區塊驗證(共識) 總結 引言 上一篇我們已經知道了什么是區塊鏈,此篇說一下區塊鏈的第一個應用——位元幣。其實先有位元幣,后有的區塊 ......

    uj5u.com 2020-09-10 03:06:15 more
  • 北斗對時服務器(北斗對時設備)電力系統應用

    北斗對時服務器(北斗對時設備)電力系統應用 北斗對時服務器(北斗對時設備)電力系統應用 京準電子科技官微(ahjzsz) 中國北斗衛星導航系統(英文名稱:BeiDou Navigation Satellite System,簡稱BDS),因為是目前世界范圍內唯一可以大面積提供免費定位服務的系統,所以 ......

    uj5u.com 2020-09-10 03:06:20 more
最新发布
  • web3 產品介紹:metamask 錢包 使用最多的瀏覽器插件錢包

    Metamask錢包是一種基于區塊鏈技術的數字貨幣錢包,它允許用戶在安全、便捷的環境下管理自己的加密資產。Metamask錢包是以太坊生態系統中最流行的錢包之一,它具有易于使用、安全性高和功能強大等優點。 本文將詳細介紹Metamask錢包的功能和使用方法。 一、 Metamask錢包的功能 數字資 ......

    uj5u.com 2023-04-20 08:46:47 more
  • Hyperledger Fabric 使用 CouchDB 和復雜智能合約開發

    在上個實驗中,我們已經實作了簡單智能合約實作及客戶端開發,但該實驗中智能合約只有基礎的增刪改查功能,且其中的資料管理功能與傳統 MySQL 比相差甚遠。本文將在前面實驗的基礎上,將 Hyperledger Fabric 的默認資料庫支持 LevelDB 改為 CouchDB 模式,以實作更復雜的資料... ......

    uj5u.com 2023-04-16 07:28:31 more
  • .NET Core 波場鏈離線簽名、廣播交易(發送 TRX和USDT)筆記

    Get Started NuGet You can run the following command to install the Tron.Wallet.Net in your project. PM> Install-Package Tron.Wallet.Net 配置 public reco ......

    uj5u.com 2023-04-14 08:08:00 more
  • DKP 黑客分析——不正確的代幣對比率計算

    概述: 2023 年 2 月 8 日,針對 DKP 協議的閃電貸攻擊導致該協議的用戶損失了 8 萬美元,因為 execute() 函式取決于 USDT-DKP 對中兩種代幣的余額比率。 智能合約黑客概述: 攻擊者的交易:0x0c850f,0x2d31 攻擊者地址:0xF38 利用合同:0xf34ad ......

    uj5u.com 2023-04-07 07:46:09 more
  • Defi開發簡介

    Defi開發簡介 介紹 Defi是去中心化金融的縮寫, 是一項旨在利用區塊鏈技術和智能合約創建更加開放,可訪問和透明的金融體系的運動. 這與傳統金融形成鮮明對比,傳統金融通常由少數大型銀行和金融機構控制 在Defi的世界里,用戶可以直接從他們的電腦或移動設備上訪問廣泛的金融服務,而不需要像銀行或者信 ......

    uj5u.com 2023-04-05 08:01:34 more
  • solidity簡單的ERC20代幣實作

    // SPDX-License-Identifier: GPL-3.0 pragma solidity >=0.7.0 <0.9.0; import "hardhat/console.sol"; //ERC20 同質化代幣,每個代幣的本質或性質都是相同 //ETH 是原生代幣,它不是ERC20代幣, ......

    uj5u.com 2023-03-21 07:56:29 more
  • solidity 參考型別修飾符memory、calldata與storage 常量修飾符C

    在solidity語言中 參考型別修飾符(參考型別為存盤空間不固定的數值型別) memory、calldata與storage,它們只能修飾參考型別變數,比如字串、陣列、位元組等... memory 適用于方法傳參、返參或在方法體內使用,使用完就會清除掉,釋放記憶體 calldata 僅適用于方法傳參 ......

    uj5u.com 2023-03-08 07:57:54 more
  • solidity注解標簽

    在solidity語言中 注釋符為// 注解符為/* 內容*/ 或者 是 ///內容 注解中含有這幾個標簽給予我們使用 @title 一個應該描述合約/介面的標題 contract, library, interface @author 作者的名字 contract, library, interf ......

    uj5u.com 2023-03-08 07:57:49 more
  • 評價指標:相似度、GAS消耗

    【代碼注釋自動生成方法綜述】 這些評測指標主要來自機器翻譯和文本總結等研究領域,可以評估候選文本(即基于代碼注釋自動方法而生成)和參考文本(即基于手工方式而生成)的相似度. BLEU指標^[^?88^^?^]^:其全稱是bilingual evaluation understudy.該指標是最早用于 ......

    uj5u.com 2023-02-23 07:27:39 more
  • 基于NOSTR協議的“公有制”版本的Twitter,去中心化社交軟體Damus

    最近,一個幽靈,Web3的幽靈,在網路游蕩,它叫Damus,這玩意詮釋了什么叫做病毒式營銷,滑稽的是,一個Web3產品卻在Web2的產品鏈上瘋狂傳銷,各方大佬紛紛為其背書,到底發生了什么?Damus的葫蘆里,賣的是什么藥? 注冊和簡單實用 很少有什么產品在用戶注冊環節會有什么噱頭,但Damus確實出 ......

    uj5u.com 2023-02-05 06:48:39 more