백엔드 개발 파이썬 튜토리얼 python网络编程学习笔记(七):HTML和XHTML解析(HTMLParser、BeautifulSoup)

python网络编程学习笔记(七):HTML和XHTML解析(HTMLParser、BeautifulSoup)

Jun 06, 2016 am 11:31 AM
html python xhtml 분석하다

一、利用HTMLParser进行网页解析
具体HTMLParser官方文档可参考http://docs.python.org/library/htmlparser.html#HTMLParser.HTMLParser

1、从一个简单的解析例子开始
例1:
test1.html文件内容如下:

代码如下:




XHTML 与 HTML 4.01 标准没有太多的不同


i love you


下面是能够列出title和body的程序示例:

代码如下:


##@小五义:
##HTMLParser示例
import HTMLParser
class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['title','body'] #提出标签
        self.processing=None
        HTMLParser.HTMLParser.__init__(self)
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            self.data=''
            self.processing=tag
    def handle_data(self,data):
        if self.processing:
            self.data +=data
    def handle_endtag(self,tag):
        if tag==self.processing:
            print str(tag)+':'+str(tp.gettitle())
            self.processing=None
    def gettitle(self):
        return self.data
fd=open('test1.html')
tp=TitleParser()
tp.feed(fd.read())

运行结果如下:
title: XHTML 与 HTML 4.01 标准没有太多的不同
body:
i love you
程序定义了一个TitleParser类,它是HTMLParser类的子孙。HTMLParser的feed方法将接收数据,并通过定义的HTMLParser对象对数据进行相应的解析。其中handle_starttag、handle_endtag判断起始和终止tag,handle_data检查是否取得数据,如果self.processing不为None,那么就取得数据。

2、解决html实体问题
(HTML 中有用的字符实体)
(1)实体名称
当与到HTML中的实体问题时,上面的例子就无法实现,如这里将test1.html的代码改为:
例2:

代码如下:




XHTML 与" HTML 4.01 "标准没有太多的不同


i love you×


利用上面的例子进行分析,其结果是:
title: XHTML 与 HTML 4.01 标准没有太多的不同
body:
i love you
实体完全消失了。这是因为当出现实体的时候,HTMLParser调用了handle_entityref()方法,因为代码中没有定义这个方法,所以就什么都没有做。经过修改后,如下:

代码如下:


##@小五义:
##HTMLParser示例:解决实体问题
from htmlentitydefs import entitydefs
import HTMLParser
class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['title','body']
        self.processing=None
        HTMLParser.HTMLParser.__init__(self)
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            self.data=''
            self.processing=tag
    def handle_data(self,data):
        if self.processing:
            self.data +=data
    def handle_endtag(self,tag):
        if tag==self.processing:
            print str(tag)+':'+str(tp.gettitle())
            self.processing=None
    def handle_entityref(self,name):
        if entitydefs.has_key(name):
            self.handle_data(entitydefs[name])
        else:
            self.handle_data('&'+name+';')
    def gettitle(self):
        return self.data
fd=open('test1.html')
tp=TitleParser()
tp.feed(fd.read())

运行结果为:
title: XHTML 与" HTML 4.01 "标准没有太多的不同
body:
i love you×
这里就把所有的实体显示出来了。

(2)实体编码
例3:

代码如下:




XHTML 与" HTML 4.01 "标准没有太多的不同


i love÷ you×


如果利用例2的代码执行后结果为:

title: XHTML 与" HTML 4.01 "标准没有太多的不同
body:
i love you×
结果中÷ 对应的÷没有显示出来。
添加handle_charref()进行处理,具体代码如下:

代码如下:


##@小五义:
##HTMLParser示例:解决实体问题
from htmlentitydefs import entitydefs
import HTMLParser
class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['title','body']
        self.processing=None
        HTMLParser.HTMLParser.__init__(self)
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            self.data=''
            self.processing=tag
    def handle_data(self,data):
        if self.processing:
            self.data +=data
    def handle_endtag(self,tag):
        if tag==self.processing:
            print str(tag)+':'+str(tp.gettitle())
            self.processing=None
    def handle_entityref(self,name):
        if entitydefs.has_key(name):
            self.handle_data(entitydefs[name])
        else:
            self.handle_data('&'+name+';')

    def handle_charref(self,name):
        try:
            charnum=int(name)
        except ValueError:
            return
        if charnum255:
            return
        self.handle_data(chr(charnum))

    def gettitle(self):
        return self.data
fd=open('test1.html')
tp=TitleParser()
tp.feed(fd.read())

运行结果为:
title: XHTML 与" HTML 4.01 "标准没有太多的不同
body:
i love÷ you×

3、提取链接
例4:

代码如下:




XHTML 与" HTML 4.01 "标准没有太多的不同

i love÷ you×


这里在handle_starttag(self,tag,attrs)中,tag=a时,attrs记录了属性值,因此只需要将attrs中name=href的value提出即可。具体如下:

代码如下:


##@小五义:
##HTMLParser示例:提取链接
# -*- coding: cp936 -*-
from htmlentitydefs import entitydefs
import HTMLParser
class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['title','body']
        self.processing=None
        HTMLParser.HTMLParser.__init__(self)       
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            self.data=''
            self.processing=tag
        if tag =='a':
            for name,value in attrs:
                if name=='href':
                    print '连接地址:'+value
    def handle_data(self,data):
        if self.processing:
            self.data +=data
    def handle_endtag(self,tag):
        if tag==self.processing:
            print str(tag)+':'+str(tp.gettitle())
            self.processing=None
    def handle_entityref(self,name):
        if entitydefs.has_key(name):
            self.handle_data(entitydefs[name])
        else:
            self.handle_data('&'+name+';')

    def handle_charref(self,name):
        try:
            charnum=int(name)
        except ValueError:
            return
        if charnum255:
            return
        self.handle_data(chr(charnum))

    def gettitle(self):
        return self.data
fd=open('test1.html')
tp=TitleParser()
tp.feed(fd.read())

运行结果为:
title: XHTML 与" HTML 4.01 "标准没有太多的不同
连接地址:http://pypi.python.org/pypi
body:

i love÷ you×

4、提取图片
如果网页中有一个图片文件,将其提取出来,并存为一个单独的文件。
例5:

代码如下:




XHTML 与" HTML 4.01 "标准没有太多的不同


i love÷ you×
我想你
python网络编程学习笔记(七):HTML和XHTML解析(HTMLParser、BeautifulSoup)



将baidu_sylogo1.gif存取出来,具体代码如下:

代码如下:


##@小五义:
##HTMLParser示例:提取图片
# -*- coding: cp936 -*-
from htmlentitydefs import entitydefs
import HTMLParser,urllib
def getimage(addr):#提取图片并存在当前目录下
    u = urllib.urlopen(addr)
    data = u.read()
    filename=addr.split('/')[-1]
    f=open(filename,'wb')
    f.write(data)
    f.close()
    print filename+'已经生成!'

class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['title','body']
        self.processing=None
        HTMLParser.HTMLParser.__init__(self)       
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            self.data=''
            self.processing=tag
        if tag =='a':
            for name,value in attrs:
                if name=='href':
                    print '连接地址:'+value
        if tag=='img':
            for name,value in attrs:
                if name=='src':
                    getimage(value)
    def handle_data(self,data):
        if self.processing:
            self.data +=data
    def handle_endtag(self,tag):
        if tag==self.processing:
            print str(tag)+':'+str(tp.gettitle())
            self.processing=None
    def handle_entityref(self,name):
        if entitydefs.has_key(name):
            self.handle_data(entitydefs[name])
        else:
            self.handle_data('&'+name+';')

    def handle_charref(self,name):
        try:
            charnum=int(name)
        except ValueError:
            return
        if charnum255:
            return
        self.handle_data(chr(charnum))

    def gettitle(self):
        return self.data
fd=open('test1.html')
tp=TitleParser()
tp.feed(fd.read())

运动结果为:
title: XHTML 与" HTML 4.01 "标准没有太多的不同
连接地址:http://pypi.python.org/pypi
baidu_sylogo1.gif已经生成!
body:
i love÷ you×
?ò????

5、实际例子:
例6、获取人人网首页上的各各链接地址,代码如下:

代码如下:


##@小五义:
##HTMLParser示例:获取人人网首页上的各各链接地址
#coding: utf-8
from htmlentitydefs import entitydefs
import HTMLParser,urllib
def getimage(addr):
    u = urllib.urlopen(addr)
    data = u.read()
    filename=addr.split('/')[-1]
    f=open(filename,'wb')
    f.write(data)
    f.close()
    print filename+'已经生成!'
class TitleParser(HTMLParser.HTMLParser):
    def __init__(self):
        self.taglevels=[]
        self.handledtags=['a']
        self.processing=None
        self.linkstring=''
        self.linkaddr=''
        HTMLParser.HTMLParser.__init__(self)       
    def handle_starttag(self,tag,attrs):
        if tag in self.handledtags:
            for name,value in attrs:
                if name=='href':
                    self.linkaddr=value
            self.processing=tag

    def handle_data(self,data):
        if self.processing:
            self.linkstring +=data
            #print data.decode('utf-8')+':'+self.linkaddr
    def handle_endtag(self,tag):
        if tag==self.processing:
            print self.linkstring.decode('utf-8')+':'+self.linkaddr
            self.processing=None
            self.linkstring=''
    def handle_entityref(self,name):
        if entitydefs.has_key(name):
            self.handle_data(entitydefs[name])
        else:
            self.handle_data('&'+name+';')

    def handle_charref(self,name):
        try:
            charnum=int(name)
        except ValueError:
            return
        if charnum255:
            return
        self.handle_data(chr(charnum))

    def gettitle(self):
        return self.linkaddr
tp=TitleParser()
tp.feed(urllib.urlopen('http://www.renren.com/').read())

运行结果:
分享:http://share.renren.com
应用程序:http://app.renren.com
公共主页:http://page.renren.com
人人生活:http://life.renren.com
人人小组:http://xiaozu.renren.com/
同名同姓:http://name.renren.com
人人中学:http://school.renren.com/allpages.html
大学百科:http://school.renren.com/daxue/
人人热点:http://life.renren.com/hot
人人小站:http://zhan.renren.com/
人人逛街:http://j.renren.com/
人人校招:http://xiaozhao.renren.com/
:http://www.renren.com
注册:http://wwv.renren.com/xn.do?ss=10113&rt=27
登录:http://www.renren.com/
帮助:http://support.renren.com/helpcenter
给我们提建议:http://support.renren.com/link/suggest
更多:#
:javascript:closeError();
打开邮箱查收确认信:#
重新输入:javascript:closeError();
:javascript:closeStop();
客服:http://help.renren.com/#http://help.renren.com/support/contomvice?pid=2&selection={couId:193,proId:342,cityId:1000375}
:javascript:closeLock();
立即解锁:http://safe.renren.com/relive.do
忘记密码?:http://safe.renren.com/findPass.do
忘记密码?:http://safe.renren.com/findPass.do
换一张:javascript:refreshCode_login();
MSN:#
360:https://openapi.360.cn/oauth2/authorize?client_id=5ddda4458747126a583c5d58716bab4c&response_type=code&redirect_uri=http://www.renren.com/bind/tsz/tszLoginCallBack&scope=basic&display=default
天翼:https://oauth.api.189.cn/emp/oauth2/authorize?app_id=296961050000000294&response_type=code&redirect_uri=http://www.renren.com/bind/ty/tyLoginCallBack
为什么要填写我的生日?:#birthday
看不清换一张?:javascript:refreshCode();
想了解更多人人网功能?点击此处:javascript:;
:javascript:;
:javascript:;
立刻注册:http://reg.renren.com/xn6245.do?ss=10113&rt=27
关于:http://www.renren.com/siteinfo/about
开放平台:http://dev.renren.com
人人游戏:http://wan.renren.com
公共主页:http://page.renren.com/register/regGuide/
手机人人:http://mobile.renren.com/mobilelink.do?psf=40002
团购:http://www.nuomi.com
皆喜网:http://www.jiexi.com
营销服务:http://ads.renren.com
招聘:http://job.renren-inc.com/
客服帮助:http://support.renren.com/helpcenter
隐私:http://www.renren.com/siteinfo/privacy
京ICP证090254号:http://www.miibeian.gov.cn/
互联网药品信息服务资格证:http://a.xnimg.cn/n/core/res/certificate.jpg

二、利用BeautifulSoup进行网页解析
1、BeautifulSoup下载和安装
下载地址:http://www.crummy.com/software/BeautifulSoup/download/3.x/
中文文档地址:http://www.crummy.com/software/BeautifulSoup/bs3/documentation.zh.html#Entity%20Conversion
安装方法:将下载的文件解压缩后,文件夹下有个setup.py文件,然后在cmd下,运行python setup.py install进行安装,注意setup.py的路径问题。安装成功后,在python中就可以直接import BeautifulSoup了。
2、从一个简单的解析例子开始
例7:

代码如下:




XHTML 与" HTML 4.01 "标准没有太多的不同


i love÷ you×
我想你
python网络编程学习笔记(七):HTML和XHTML解析(HTMLParser、BeautifulSoup)



获取title的代码:

代码如下:


##@小五义:
##BeautifulSoup示例:title
#coding: utf8
import BeautifulSoup

a=open('test1.html','r')
htmlline=a.read()
soup=BeautifulSoup.BeautifulSoup(htmlline.decode('gb2312'))
#print soup.prettify()#规范化html文件
titleTag=soup.html.head.title
print titleTag.string


运行结果:
XHTML 与" HTML 4.01 "标准没有太多的不同
从代码和结果来看,应注意两点:
第一,在BeautifulSoup.BeautifulSoup(htmlline.decode('gb2312'))初始化过程中,应注意字符编码格式,从网上搜索了一下,开始用utf-8的编码显示不正常,换为gb2312后显示正常。其实可以用soup.originalEncoding方法来查看原文件的编码格式。
第二,结果中未对字符实体进行处理,在BeautifulSoup中文文档中,有专门对实体转换的解释,这里将上面的代码改为以下代码后,结果将正常显示:

代码如下:


##@小五义:
##BeautifulSoup示例:title
#coding: utf8
import BeautifulSoup
a=open('test1.html','r')
htmlline=a.read()
soup=BeautifulSoup.BeautifulStoneSoup(htmlline.decode('gb2312'),convertEntities=BeautifulSoup.BeautifulStoneSoup.ALL_ENTITIES)
#print soup.prettify()#规范化html文件
titleTag=soup.html.head.title
print titleTag.string

这里convertEntities=BeautifulSoup.BeautifulStoneSoup.ALL_ENTITIES中的ALL_ENTITIES定义了XML和HTML两者的实体代码。当然,也可以直接用XML_ENTITIES或者HTML_ENTITIES。运行结果如下:
XHTML 与" HTML 4.01 "标准没有太多的不同
3、提取链接
还有用上面的例子,这里代码变为:

代码如下:


##@小五义:
##BeautifulSoup示例:提取链接
#coding: utf8
import BeautifulSoup
a=open('test1.html','r')
htmlline=a.read()
a.close()
soup=BeautifulSoup.BeautifulStoneSoup(htmlline.decode('gb2312'),convertEntities=BeautifulSoup.BeautifulStoneSoup.ALL_ENTITIES)
name=soup.find('a').string
links=soup.find('a')['href']
print name+':'+links

运行结果为:
我想你:http://pypi.python.org/pypi
4、提取图片
依然是用上面的例子,把baidu图片提取出来。
代码为:

代码如下:


##@小五义:http://www.cnblogs.com/xiaowuyi
#coding: utf8
import BeautifulSoup,urllib
def getimage(addr):#提取图片并存在当前目录下
    u = urllib.urlopen(addr)
    data = u.read()
    filename=addr.split('/')[-1]
    f=open(filename,'wb')
    f.write(data)
    f.close()
    print filename+' finished!'
a=open('test1.html','r')
htmlline=a.read()
soup=BeautifulSoup.BeautifulStoneSoup(htmlline.decode('gb2312'),convertEntities=BeautifulSoup.BeautifulStoneSoup.ALL_ENTITIES)
links=soup.find('img')['src']
getimage(links)

提取链接和提取图片两部分主要都是用了find方法,具体方法为:
find(name, attrs, recursive, text, **kwargs)
findAll是列出全部符合条件的,find只列出第一条。这里注意的是findAll返回的是个list。
5、实际例子:
例8、获取人人网首页上的各各链接地址,代码如下:

代码如下:


##@小五义:
##BeautifulSoup示例:获取人人网首页上的各各链接地址
#coding: utf8
import BeautifulSoup,urllib
linkname=''
htmlline=urllib.urlopen('http://www.renren.com/').read()
soup=BeautifulSoup.BeautifulStoneSoup(htmlline.decode('utf-8'))
links=soup.findAll('a')
for i in links:
    ##判断tag是a的里面,href是否存在。
    if 'href' in str(i):
        linkname=i.string
        linkaddr=i['href']
        if 'NoneType' in str(type(linkname)):#当i无内容是linkname为Nonetype类型。
            print linkaddr
        else:
            print linkname+':'+linkaddr

运行结果:
分享:http://share.renren.com
应用程序:http://app.renren.com
公共主页:http://page.renren.com
人人生活:http://life.renren.com
人人小组:http://xiaozu.renren.com/
同名同姓:http://name.renren.com
人人中学:http://school.renren.com/allpages.html
大学百科:http://school.renren.com/daxue/
人人热点:http://life.renren.com/hot
人人小站:http://zhan.renren.com/
人人逛街:http://j.renren.com/
人人校招:http://xiaozhao.renren.com/
http://www.renren.com
注册:http://wwv.renren.com/xn.do?ss=10113&rt=27
登录:http://www.renren.com/
帮助:http://support.renren.com/helpcenter
给我们提建议:http://support.renren.com/link/suggest
更多:#
javascript:closeError();
打开邮箱查收确认信:#
重新输入:javascript:closeError();
javascript:closeStop();
客服:http://help.renren.com/#http://help.renren.com/support/contomvice?pid=2&selection={couId:193,proId:342,cityId:1000375}
javascript:closeLock();
立即解锁:http://safe.renren.com/relive.do
忘记密码?:http://safe.renren.com/findPass.do
忘记密码?:http://safe.renren.com/findPass.do
换一张:javascript:refreshCode_login();
MSN:#
360:https://openapi.360.cn/oauth2/authorize?client_id=5ddda4458747126a583c5d58716bab4c&response_type=code&redirect_uri=http://www.renren.com/bind/tsz/tszLoginCallBack&scope=basic&display=default
天翼:https://oauth.api.189.cn/emp/oauth2/authorize?app_id=296961050000000294&response_type=code&redirect_uri=http://www.renren.com/bind/ty/tyLoginCallBack
#birthday
看不清换一张?:javascript:refreshCode();
javascript:;
javascript:;
立刻注册:http://reg.renren.com/xn6245.do?ss=10113&rt=27
关于:http://www.renren.com/siteinfo/about
开放平台:http://dev.renren.com
人人游戏:http://wan.renren.com
公共主页:http://page.renren.com/register/regGuide/
手机人人:http://mobile.renren.com/mobilelink.do?psf=40002
团购:http://www.nuomi.com
皆喜网:http://www.jiexi.com
营销服务:http://ads.renren.com
招聘:http://job.renren-inc.com/
客服帮助:http://support.renren.com/helpcenter
隐私:http://www.renren.com/siteinfo/privacy
京ICP证090254号:http://www.miibeian.gov.cn/
互联网药品信息服务资格证:http://a.xnimg.cn/n/core/res/certificate.jpg

본 웹사이트의 성명
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.

핫 AI 도구

Undresser.AI Undress

Undresser.AI Undress

사실적인 누드 사진을 만들기 위한 AI 기반 앱

AI Clothes Remover

AI Clothes Remover

사진에서 옷을 제거하는 온라인 AI 도구입니다.

Undress AI Tool

Undress AI Tool

무료로 이미지를 벗다

Clothoff.io

Clothoff.io

AI 옷 제거제

Video Face Swap

Video Face Swap

완전히 무료인 AI 얼굴 교환 도구를 사용하여 모든 비디오의 얼굴을 쉽게 바꾸세요!

뜨거운 도구

메모장++7.3.1

메모장++7.3.1

사용하기 쉬운 무료 코드 편집기

SublimeText3 중국어 버전

SublimeText3 중국어 버전

중국어 버전, 사용하기 매우 쉽습니다.

스튜디오 13.0.1 보내기

스튜디오 13.0.1 보내기

강력한 PHP 통합 개발 환경

드림위버 CS6

드림위버 CS6

시각적 웹 개발 도구

SublimeText3 Mac 버전

SublimeText3 Mac 버전

신 수준의 코드 편집 소프트웨어(SublimeText3)

PHP와 Python 중에서 선택 : 가이드 PHP와 Python 중에서 선택 : 가이드 Apr 18, 2025 am 12:24 AM

PHP는 웹 개발 및 빠른 프로토 타이핑에 적합하며 Python은 데이터 과학 및 기계 학습에 적합합니다. 1.PHP는 간단한 구문과 함께 동적 웹 개발에 사용되며 빠른 개발에 적합합니다. 2. Python은 간결한 구문을 가지고 있으며 여러 분야에 적합하며 강력한 라이브러리 생태계가 있습니다.

PHP와 Python : 다른 패러다임이 설명되었습니다 PHP와 Python : 다른 패러다임이 설명되었습니다 Apr 18, 2025 am 12:26 AM

PHP는 주로 절차 적 프로그래밍이지만 객체 지향 프로그래밍 (OOP)도 지원합니다. Python은 OOP, 기능 및 절차 프로그래밍을 포함한 다양한 패러다임을 지원합니다. PHP는 웹 개발에 적합하며 Python은 데이터 분석 및 기계 학습과 같은 다양한 응용 프로그램에 적합합니다.

HTML의 미래 : 웹 디자인의 진화 및 트렌드 HTML의 미래 : 웹 디자인의 진화 및 트렌드 Apr 17, 2025 am 12:12 AM

HTML의 미래는 무한한 가능성으로 가득합니다. 1) 새로운 기능과 표준에는 더 많은 의미 론적 태그와 WebComponents의 인기가 포함됩니다. 2) 웹 디자인 트렌드는 반응적이고 접근 가능한 디자인을 향해 계속 발전 할 것입니다. 3) 성능 최적화는 반응 형 이미지 로딩 및 게으른로드 기술을 통해 사용자 경험을 향상시킬 것입니다.

Python에서 비주얼 스튜디오 코드를 사용할 수 있습니다 Python에서 비주얼 스튜디오 코드를 사용할 수 있습니다 Apr 15, 2025 pm 08:18 PM

VS 코드는 파이썬을 작성하는 데 사용될 수 있으며 파이썬 애플리케이션을 개발하기에 이상적인 도구가되는 많은 기능을 제공합니다. 사용자는 다음을 수행 할 수 있습니다. Python 확장 기능을 설치하여 코드 완료, 구문 강조 및 디버깅과 같은 기능을 얻습니다. 디버거를 사용하여 코드를 단계별로 추적하고 오류를 찾아 수정하십시오. 버전 제어를 위해 git을 통합합니다. 코드 서식 도구를 사용하여 코드 일관성을 유지하십시오. 라인 도구를 사용하여 잠재적 인 문제를 미리 발견하십시오.

VScode 확장자가 악의적입니까? VScode 확장자가 악의적입니까? Apr 15, 2025 pm 07:57 PM

VS 코드 확장은 악의적 인 코드 숨기기, 취약성 악용 및 합법적 인 확장으로 자위하는 등 악성 위험을 초래합니다. 악의적 인 확장을 식별하는 방법에는 게시자 확인, 주석 읽기, 코드 확인 및주의해서 설치가 포함됩니다. 보안 조치에는 보안 인식, 좋은 습관, 정기적 인 업데이트 및 바이러스 백신 소프트웨어도 포함됩니다.

Python vs. JavaScript : 학습 곡선 및 사용 편의성 Python vs. JavaScript : 학습 곡선 및 사용 편의성 Apr 16, 2025 am 12:12 AM

Python은 부드러운 학습 곡선과 간결한 구문으로 초보자에게 더 적합합니다. JavaScript는 가파른 학습 곡선과 유연한 구문으로 프론트 엔드 개발에 적합합니다. 1. Python Syntax는 직관적이며 데이터 과학 및 백엔드 개발에 적합합니다. 2. JavaScript는 유연하며 프론트 엔드 및 서버 측 프로그래밍에서 널리 사용됩니다.

HTML : 구조, CSS : 스타일, 자바 스크립트 : 동작 HTML : 구조, CSS : 스타일, 자바 스크립트 : 동작 Apr 18, 2025 am 12:09 AM

웹 개발에서 HTML, CSS 및 JavaScript의 역할은 다음과 같습니다. 1. HTML은 웹 페이지 구조를 정의하고, 2. CSS는 웹 페이지 스타일을 제어하고 3. JavaScript는 동적 동작을 추가합니다. 그들은 함께 현대 웹 사이트의 프레임 워크, 미학 및 상호 작용을 구축합니다.

vScode를 Mac에 사용할 수 있습니다 vScode를 Mac에 사용할 수 있습니다 Apr 15, 2025 pm 07:36 PM

VS 코드는 Mac에서 사용할 수 있습니다. 강력한 확장, GIT 통합, 터미널 및 디버거가 있으며 풍부한 설정 옵션도 제공합니다. 그러나 특히 대규모 프로젝트 또는 고도로 전문적인 개발의 경우 VS 코드는 성능 또는 기능 제한을 가질 수 있습니다.

See all articles