BeautifulSoup_Python 登录_beautifulsoup中文文档(2)

电脑杂谈  发布时间:2017-02-19 02:08:31  来源:网络整理

28 images.append(image)

29

30 # now we change the images url

31

32 for i in range(len_img):

33 images_src[i]['src'] = pro_image + images_src[i].attrs[0][1].split('/')[-1]

34

35 #title

36 table_title = table.find('h1')

37 table_title.hidden = True

38 #title below limits description

39 table_limit_des = table_title.findNext('span')

40 table_limit_des.hidden = True

41 # problem description, input, output, sample input, sample output

42 try:

43 table_problem_des = table.find(text='Problem Description').findNext('div', {'class':'panel_content'})

44 table_problem_des.hidden = True

45 except Exception as e:

46 table_problem_des = None

47

48 #input

49 try:

50 table_input = table.find(text='Input').findNext('div', {'class':'panel_content'})

51 table_input.hidden = True

52 except Exception as e:

53 table_input = None

54 #output

55 try:

56 table_output = table.find(text='Output').findNext('div', {'class':'panel_content'})

57 table_output.hidden = True

58 except Exception as e:

59 table_output = None

60 #sample input

61 try:

62 table_sample_input = table.find(text='Sample Input').findNext('div', {'class':'panel_content'})

63 table_sample_input.hidden = True

64 except Exception as e:

65 table_sample_input = None

66 #sample output

67 try:

68 table_sample_output = table.find(text='Sample Output').findNext('div', {'class':'panel_content'})

69 table_sample_output.hidden = True

70 except Exception as e:

71 table_sample_output = None

72

73 # hint

74 try:

75 table_hint = table_sample_output.i.next.next


本文来自电脑杂谈,转载请注明本文网址:
https://www.pc-fly.com/a/jisuanjixue/article-33239-2.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...