因此,我正在尝试获取此网站上我正在从事的项目的事件页面链接。 http://njii.com/events/。因此,我知道在经过html之后,我想要的事件链接位于<div class="vc_pageable-slider-wrapper vc_clearfix" data-vc-grid-content="true">
我的代码如下
from bs4 import BeautifulSoup
import requests
r = requests.get("http://njii.com/events/")
data=r.text
soup = BeautifulSoup(data)
for link in soup.find_all('a', {'div class': ['vc_pageable-slider-wrapper vc_clearfix']}):
print(link.get('href'))
这是python和是的。当我尝试这样做时,它给我空白。当我做一些简单的事情,例如soup.find_all('a')时,它为我提供了那里的每个链接,但我不需要。我只需要课程中那个特定位置的链接。我不确定我是否正确使用了findall,并在正确使用它方面遇到问题。
答案 0 :(得分:1)
In[2]: import requests
...: from bs4 import BeautifulSoup
...:
...: params = {
...: 'action': 'vc_get_vc_grid_data',
...: 'tag': 'vc_basic_grid',
...: 'data[page_id]': 26,
...: 'data[shortcode_id]': '1524685605316-ae64dc93-e23d-3',
...: '_vcnonce': 'd8a62b4a27'
...: }
...: url = 'http://njii.com/wp-admin/admin-ajax.php'
...: r = requests.get(url, params=params)
...: soup = BeautifulSoup(r.text, 'lxml')
In[3]: for div in soup.find_all('div', class_='vc_gitem-animated-block'):
...: print(div.find('a')['href'])
...:
http://njii.com/2018/10/09/new-jersey-institute-of-technology-to-host-tedxnjit-event/
http://njii.com/2018/10/09/new-jersey-innovation-institute-to-host-how-innovation-innovation-hubs-benefit-business-new-jersey/
http://njii.com/2018/10/03/raul-mercado-named-honorary-commander-joint-base-mcguire-dix-lakehurst/
http://njii.com/2018/09/27/new-jersey-innovation-institute-launches-its-cell-gene-therapy-center-at-an-industry-cell-therapy-manufacturing-roundtable-hosted-at-njit/
http://njii.com/2018/09/21/interview-with-rachel-trobman-ceo-co-founder-of-upside-health/
http://njii.com/2018/09/13/new-jersey-innovation-institute-and-rwjbarnabas-health-announce-smart-hospital-challenge/
http://njii.com/2018/09/12/njii-to-host-the-first-annual-nj-aerospace-defense-coalition-summit/
http://njii.com/2018/08/24/new-jersey-innovation-institute-recruiting-ninth-cohort-for-health-it-connections-program-business-development-for-scale-up-health-it-companies/
http://njii.com/2018/08/20/interview-with-david-wagstaff-founder-of-alfrea-wellness/
http://njii.com/2018/08/02/njii-partners-with-corsis-to-foster-digital-healthit-innovation/
http://njii.com/2018/07/27/njiis-balavignesh-thirumalainambi-named-njbiz-2018-forty-under-40-winner/
http://njii.com/2018/07/11/next-wave-of-solar-development-gets-strong-start-at-brightfields-2018/
http://njii.com/2018/07/06/interview-with-linh-le-ceo-of-bonbouton/
http://njii.com/2018/06/21/why-clinicians-should-care-about-mips/
http://njii.com/2018/06/08/new-jersey-innovation-institute-to-host-brightfields-2018/
http://njii.com/2018/05/24/interview-with-emmanuel-dumont-ceo-of-shade/
http://njii.com/2018/05/17/executive-women-of-new-jersey-honored-judith-sheft-from-the-new-jersey-innovation-institute-at-biennial-salute-to-the-policy-makers-gala/
http://njii.com/2018/05/14/new-jersey-innovation-institute-and-healrworld-form-sustainability-accelerator/
http://njii.com/2018/05/04/george-nikolaou-njiis-executive-director-financial-services-innovation-to-moderate-blockchain-panel-at-2018-njbia-cybersecurity-summit/
http://njii.com/2018/04/20/interview-with-curt-bashford-ceo-of-general-devices-gd/
http://njii.com/2018/03/28/njii-hosts-canada-health-innovation-day/
http://njii.com/2018/03/26/interview-with-melissa-kozak-ceo-and-co-founder-of-citus-health/
http://njii.com/2018/03/23/citus-health-takes-home-cash-prize-at-2018-healthcare-innovation-showcase/
http://njii.com/2018/03/22/2018-annual-innovation-showcase-highlights-new-technology-tools-for-the-medical-neighborhood/
http://njii.com/2018/03/15/new-jersey-innovation-institutes-cell-gene-therapy-development-center-launches-workforce-training-program-for-biopharma-professionals/
http://njii.com/2018/03/15/njit-to-host-metrolab-network-2018-national-summit-with-technology-government-and-academic-leaders/
http://njii.com/2018/02/27/five-members-of-njii-board-of-directors-named-to-roi-nj-influencers-power-list-2018/
http://njii.com/2018/02/19/interview-with-hari-prasad-ceo-and-co-founder-of-yosi/
http://njii.com/2018/01/18/interview-with-health-it-connections-member-paula-muller-sociavi/
http://njii.com/2017/12/20/interview-with-heather-waibel-ceo-and-founder-of-welnys/
http://njii.com/2017/11/30/judith-sheft-honored-by-new-jersey-technology-council/
http://njii.com/2017/11/30/german-american-chamber-of-commerce-selects-new-jersey-innovation-institute-to-host-smart-city-seminar/
http://njii.com/2017/11/14/interview-with-ed-young-ceo-of-ez-waiting-room/
http://njii.com/2017/11/14/enterprise-development-center-hosts-entrepreneurial-venture-summit/
http://njii.com/2017/11/07/24-day-left-to-submit-an-informal-review-request/
http://njii.com/2017/10/26/ask-ina-how-do-mu-pqrs-transition-to-mips/
http://njii.com/2017/10/26/ask-ina-aci-exception/
http://njii.com/2017/10/24/interview-with-julien-delpech-ceo-of-invivox/
http://njii.com/2017/10/17/the-new-jersey-innovation-institute-and-rutgers-university-announce-plans-to-form-the-new-jersey-continuous-manufacturing-institute/
http://njii.com/2017/10/11/edcr-receives-small-business-supporter-of-year-award-from-essex-county-latino-american-chamber-of-commerce/
http://njii.com/2017/09/25/njii-launches-aerospace-defense-coalition/
http://njii.com/2017/09/21/ask-ina-pqrs-vs-mips/
http://njii.com/2017/09/18/interview-with-john-phelan-ceo-of-zweena-health/
http://njii.com/2017/09/15/new-jersey-innovation-institutes-health-it-connections-program-receives-state-science-and-technology-institute-award/
http://njii.com/2017/09/11/the-njii-defense-and-homeland-security-innovation-lab-is-working-with-maser-consulting-p-a-in-conducting-unmanned-aerial-vehicle-uav-video-inspection-of-cell-towers-in-houston-texas-in-the-afterma/
http://njii.com/2017/08/24/interview-with-adam-turinas-ceo-uniphy-health/
http://njii.com/2017/08/18/hackensack-meridian-health-and-the-new-jersey-innovation-institute-launch-program-to-support-new-health-care-products-and-strategies/
http://njii.com/2017/08/16/ken-fishbain-healthcare-executive-joins-uniphy-health-advisory-board/
http://njii.com/2017/08/08/tugba-aksoy-appointed-client-engagement-manager-economic-cluster-development-new-jersey-innovation-institute/
http://njii.com/2017/08/08/njiis-colette-santasieri-receives-2017-njit-distinguished-alumni-award/
http://njii.com/2017/08/01/new-jersey-startup-vognition-gets-funding-from-njit-highlanders/
http://njii.com/2017/07/25/biopharmaceutical-product-development-data-science-symposium/
http://njii.com/2017/07/14/njii-recruiting-seventh-cohort-for-health-it-connections-program-business-development-for-scale-up-health-it-companies/
http://njii.com/2017/07/12/interview-with-mike-oneill-ceo-of-medicasoft/
http://njii.com/2017/06/27/thomas-bartiromo-named-2017-healthcare-innovation-hero-by-njbiz/
http://njii.com/2017/06/23/nterview-with-craig-limoli-founder-wellsheet/
http://njii.com/2017/06/20/the-new-jersey-innovation-institute-introduces-two-groundbreaking-biopharmaceutical-centers/
http://njii.com/2017/06/15/5378/
http://njii.com/2017/06/13/new/
http://njii.com/2017/06/09/the-enterprise-development-center-on-the-njit-campus-will-host-live-auditions-for-girl-starter/
http://njii.com/2017/05/12/two-njii-cohorts-working-together/
http://njii.com/2017/05/12/interview-with-jordan-leahy-founder-ht-developers/
http://njii.com/2017/05/11/mips-webinar-aco-problem-solving-strategies-for-mips-apm-success/
http://njii.com/2017/05/11/mips-webinar-learn-about-njiis-strategies-for-your-mips-success/
http://njii.com/2017/05/10/practice-transformation-learning-event-making-the-case-for-value-based-care/
http://njii.com/2017/05/10/nj-doh-2017-population-health-summit/
http://njii.com/2017/05/09/2017-innovation-showcase-using-technology-to-transform-the-practice-of-medicine/
http://njii.com/2017/05/08/arkados-completes-the-acquisition-of-solbright-renewable-energy/
http://njii.com/2017/05/01/business-value-proposition-design-understanding-your-customer-workshop/
http://njii.com/2017/04/26/d3-unified-communications-selected-to-pitch-at-19th-annual-angel-venture-fair/
http://njii.com/2017/04/26/njit-and-njii-to-host-local-innovateher-feeder-competition/
http://njii.com/2017/04/26/njii-opens-agile-strategy-lab-in-renovated-central-king-building/
http://njii.com/2017/04/25/powering-americas-innovation-economy-women-leading-in-stem/
http://njii.com/2017/04/21/the-annual-innovation-showcase-using-technology-to-transform-the-practice-of-medicine/
http://njii.com/2017/04/19/2017-innovateher-innovating-for-women-business-challenge/
http://njii.com/2017/03/30/getting-ready-to-open-a-drone-incubator-in-south-jersey-read-more-getting-ready-to-open-a-drone-incubator-in-south-jersey-httpnj1015-comgetting-ready-to-open-a-drone-incubator-in-south-jersey/
http://njii.com/2017/03/29/interview-with-david-barnett-founder-chairman-and-coo-of-corsis/
http://njii.com/2017/03/23/njit-presidents-forum/
http://njii.com/2017/03/22/new-jersey-innovation-institute-announces-development-of-ideation-center-in-partnership-with-hackensack-meridian-health/
http://njii.com/2017/03/22/new-jersey-innovation-institute-hosts-fourth-annual-big-data-symposium/
http://njii.com/2017/03/22/tomas-gregorio-ranked-19-in-njbiz-power-50-health-care-list/
http://njii.com/2017/03/21/arkados-signs-letter-of-intent-to-acquire-solbright-renewable-energy/
http://njii.com/2017/03/21/new-jersey-is-progressive-in-promoting-stem/
http://njii.com/2017/03/17/enterprise-development-center-to-co-host-global-intellectual-property-and-business-symposium/
http://njii.com/2017/03/16/edc-awarded-international-business-innovation-association-inbia-soft-landings-designation/
http://njii.com/2017/03/16/how-to-win-an-investors-attention-pitch-deck-coaching-session/
http://njii.com/2017/03/15/on-the-horizon-the-cancer-breath-test/
http://njii.com/2017/03/10/womens-history-month-marjorie-perry/
http://njii.com/2017/03/09/phone-com-innovation-and-collaboration-tools-take-center-stage-at-sxsw/
http://njii.com/2017/03/06/will-you-lose-your-job-to-a-robot-not-if-you-keep-up-nj-experts-say/
http://njii.com/2017/03/01/womens-history-month-judith-sheft/
http://njii.com/2017/03/01/save-the-date-for-edcs-annual-venture-summit/
http://njii.com/2017/02/28/global-intellectual-property-business-symsposium/
http://njii.com/2017/02/28/techlaunch-bull-pen-njit/
http://njii.com/2017/02/28/optimum-open-house-info-session/
http://njii.com/2017/02/23/interview-with-yasir-ali-ceo-and-co-founder-of-rivews/
http://njii.com/2017/02/14/how-does-pqrs-improve-your-practice/
http://njii.com/2017/02/13/phone-com-receives-2017-internet-telephony-product-of-the-year-award/
http://njii.com/2017/02/07/ip-breakfast-series-with-wiggin-and-dana/
http://njii.com/2017/02/01/rxwiki-telemanager-merge-to-create-digital-pharmacist-inc/
http://njii.com/2017/01/19/interview-with-mubeen-malik-vice-president-of-genoa-a-qol-healthcare-company/
http://njii.com/2017/01/18/lunch-and-learn-drive-growth-and-engagement-with-social-media/
http://njii.com/2017/01/17/book-smarts-christopher-domey-16/
http://njii.com/2017/01/13/longstanding-edc-company-mzm-construction-accepts-corporate-award-from-womens-political-caucus-of-nj/
http://njii.com/2017/01/11/new-jersey-innovation-institutes-michael-van-ter-sluis-to-present-at-dia-supply-chain-mapping-seminar/
http://njii.com/2017/01/11/new-jersey-innovation-institute-awarded-brownfield-coalition-contract/
http://njii.com/2017/01/10/business-model-canvas-workshop/
http://njii.com/2017/01/01/lunch-and-learn-seminar-legal-toolkit-for-small-business-growth/
http://njii.com/2016/12/30/how-to-brand-your-business-like-a-pro-with-njit-procurement-technical-assistance-center-ptac/
http://njii.com/2016/12/22/interview-with-juby-george-vazevice-president-of-globex-healthcare/
http://njii.com/2016/12/21/new-jersey-inventors-hall-awards-the-enterprise-development-center-with-invention-process-award/
http://njii.com/2016/12/21/knowhen-in-fox-news-health/
http://njii.com/2016/12/13/njit-biomedical-engineering-info-session/
http://njii.com/2016/12/13/womens-political-caucus-of-nj-selects-mzm-construction-for-2017-corporate-award/
http://njii.com/2016/12/13/lunch-and-learn-seminar-how-to-accelerate-startup-growth/
http://njii.com/2016/12/09/webinar-practice-transformation-done-right/
http://njii.com/2016/12/09/drone-technology-takes-off-in-new-jersey/
http://njii.com/2016/12/09/getting-started-with-pqrs-at-njii-webinar-monday-1212/
http://njii.com/2016/12/09/why-practice-transformation-is-important/
http://njii.com/2016/12/09/talk-from-the-heart-dr-thomas-ortiz/
http://njii.com/2016/12/09/succeed-with-gptn/
http://njii.com/2016/12/09/physicians-take-back-control-of-our-healthcare-system/
http://njii.com/2016/12/09/aco-and-mipsmacra-eligibility/
http://njii.com/2016/11/29/eir-office-hours-phil-crowley/
http://njii.com/2016/11/18/dont-forget-to-sign-up-with-njii-for-2016-pqrs/
http://njii.com/2016/11/18/pqrs-measures-group-101-webinar-1121/
http://njii.com/2016/11/17/additive-advanced-manufacturing-industry-summit/
http://njii.com/2016/11/14/haro-hartounian-to-moderate-industry-panel-at-regional-pharma-manufacturing-expo/
http://njii.com/2016/11/09/innovation-collaboration-and-business-support-from-new-jerseys-universities/
http://njii.com/2016/11/08/njii-conducts-courses-for-shanghai-municipal-administration-of-planning-and-land-resources/
http://njii.com/2016/11/02/interview-with-roque-espinal-valdez-founder-and-ceo-of-dn-telehealth/
http://njii.com/2016/11/01/edcs-newest-entrepreneur-in-residence-lindsey-c-holmes/
http://njii.com/2016/10/24/2948/
http://njii.com/2016/10/22/phillip-p-crowley-joins-edc-entrepreneur-in-residence-progam/
http://njii.com/2016/10/22/edc-venture-summit/
http://njii.com/2016/10/21/newark-introduces-city-wide-initiative-to-better-connect-its-residents-to-each-other-and-the-world/
http://njii.com/2016/10/18/getting-started-with-pqrs-at-njii-webinar/
http://njii.com/2016/10/06/workshop-how-to-talk-to-money-investor-pitch-coaching/
http://njii.com/2016/10/06/interview-footprintid/
http://njii.com/2016/10/05/lunch-and-learn-seminar-intellectual-property-ip-primer-with-gearhart-law/
http://njii.com/2016/10/04/njiis-2016-pqrs-enrollment-is-now-open/
http://njii.com/2016/10/03/military-park-tech-talks-audible-and-phone-com-present-digital-businesses-using-the-internet-to-fuel-commerce/
http://njii.com/2016/09/29/workshop-introduction-to-crowdfunding-in-new-jersey/
http://njii.com/2016/09/28/tedxnjit/
http://njii.com/2016/09/27/lunch-and-learn-seminar-the-investment-attraction-how-to-catch-the-attention-of-strategic-partners-investors/
http://njii.com/2016/09/26/military-park-tech-talks-njitnjiigoogles-women-techmakers-njcurrant-present-advancing-women-in-technology/
http://njii.com/2016/09/22/getting-to-know-europe-eu-and-u-s-perspectives-of-entrepreneurship-innovation-and-technology/
http://njii.com/2016/09/21/what-is-the-collaboration-paradigm/
http://njii.com/2016/09/19/military-park-tech-talks-panasonic-and-code-for-newark-present-skills-for-tomorrows-tech-professional/
http://njii.com/2016/09/12/military-park-tech-talks-gnec-and-wickr-present-leveraging-tech-startup-resources-and-capital/
http://njii.com/2016/09/02/gptn-transformation-day/
http://njii.com/2016/08/24/interview-with-niko-skievaski-co-founder-of-redox/
http://njii.com/2016/08/17/3230/
http://njii.com/2016/07/25/interview-with-bob-gold-gomo-health/
http://njii.com/2016/06/23/business-model-canvas-masterclass-workshops/
http://njii.com/2016/06/17/financial-modeling-essentials-for-raising-capital/
http://njii.com/2016/06/15/interview-with-bob-janacek/
http://njii.com/2016/06/12/workshop-financial-modeling-essentials-for-raising-capital/
http://njii.com/2016/06/10/njii-economic-cluster-development-webinar/
http://njii.com/2016/06/09/apmwebinar/
http://njii.com/2016/06/08/workplace-retirement-plans-matching-solutions-to-reach-your-goals/
http://njii.com/2016/06/02/edc-happy-hour-mixer/
http://njii.com/2016/04/27/interview-with-tom-ireland-and-peter-schmitt/
http://njii.com/2016/04/27/new-jersey-innovation-institute-and-jp-morgan-chase-small-business-forward/
http://njii.com/2016/04/27/mipswebinar/
http://njii.com/2016/04/22/wcec-internet-of-things-iot-panel-discussion/
http://njii.com/2016/04/22/selling-net-operating-losses-with-thomas-company/
http://njii.com/2016/04/22/idt-hosts-newark-tech-meetup/
http://njii.com/2016/04/22/gearhart-law-office-hours/
http://njii.com/2016/04/22/strategic-communications-for-start-ups-workshop/
http://njii.com/2016/04/22/simphotek-selected-as-njbiz-best-50-women-in-business/
http://njii.com/2016/04/22/fueling-tomorrows-innovations-edc-entrepreneurs-connect-with-njii-industry-veterans/
http://njii.com/2016/04/22/wrkbench-adding-a-visual-element-to-remote-wor/
http://njii.com/2016/04/22/menssana-wins-nih-award-press-release/
http://njii.com/2016/04/11/donald-sebastian-makes-a-guest-appearance/
http://njii.com/2016/02/16/new-jersey-innovation-institute-njii-receives-49-6-million-transforming-clinical-practice-initiative-award/
http://njii.com/2016/02/16/nj-marketshift-conducts-unmanned-aerial-vehicle-agile-strategy-workshop/
http://njii.com/2016/02/16/new-jersey-innovation-institute-awarded-2-9-million-federal-grant-to-advance-health-information-technology-services-to-support-health-information-exchange/
http://njii.com/2016/02/16/donald-h-sebastian-named-innovation-healthcare-hero-by-njbiz/