所以我最近在youtube上使用"新波士顿"视频开始学习Python,一切都很顺利,直到我开始制作一个简单的网络爬虫教程.虽然我理解它没有问题,但当我运行代码时,我得到的错误似乎都基于"SSL:CERTIFICATE_VERIFY_FAILED".自昨晚以来我一直在寻找答案,试图弄清楚如何修复它,似乎没有其他人在视频或他的网站上的评论中遇到与我相同的问题,甚至使用他的某些人的代码网站我得到了相同的结果.我将从网站上发布的代码发布代码,因为它给了我同样的错误,而我编码的代码现在变得一团糟.
import requests
from bs4 import BeautifulSoup
def trade_spider(max_pages):
page = 1
while page <= max_pages:
url = "https://www.thenewboston.com/forum/category.php?id=15&orderby=recent&page=" + str(page) #this is page of popular posts
source_code = requests.get(url)
# just get the code, no headers or anything
plain_text = source_code.text
# BeautifulSoup objects can be sorted through easy
for link in soup.findAll('a', {'class': 'index_singleListingTitles'}): #all links, which contains "" class='index_singleListingTitles' "" in it.
href = "https://www.thenewboston.com/" + link.get('href')
title = link.string # just the text, not the HTML …Run Code Online (Sandbox Code Playgroud) 我知道这是在网站的其他地方,但由于某种原因我在这里找到的答案仍然没有帮助我仍然无法让它在整天尝试不同的事情后工作.我的目标是将确认代码发送到用户输入的电子邮件.我只知道少量的PHP,并遵循登录/注册系统的教程,但我很确定php工作正常,问题在于我的sendmail.ini和php.ini.这是我的sendmail.ini
; configuration for fake sendmail
; if this file doesn't exist, sendmail.exe will look for the settings in
; the registry, under HKLM\Software\Sendmail
[sendmail]
; you must change mail.mydomain.com to your smtp server,
; or to IIS's "pickup" directory. (generally C:\Inetpub\mailroot\Pickup)
; emails delivered via IIS's pickup directory cause sendmail to
; run quicker, but you won't get error messages back to the calling
; application.
smtp_server=smtp.gmail.com
; smtp port (normally 25)
smtp_port=587
; SMTPS (SSL) support
; auto …Run Code Online (Sandbox Code Playgroud) 我是编程的新手,我注意到有人提到了弹性盒子.在阅读了很多关于它之后,它似乎对我有用.唯一的问题是我在安装它时遇到了很多麻烦,即使在搜索了大约一个小时的帮助之后.我从github下载了它,并将此链接rel="stylesheet" href="css/flexbox.min.css" type="text/css" />放在我的head标签中,但是这样的东西justify-content:center不起作用.
任何帮助将不胜感激,谢谢!