小编Owe*_*wen的帖子

用逗号和漂亮的汤代替逗号

在此输入图像描述

Html代码行如上.

我已经设法从这个网址获得它

import requests
from bs4 import BeautifulSoup as soup

url = 'https://www.saa.gov.uk/search/?SEARCHED=1&ST=&SEARCH_TERM=city+of+edinburgh%2C+BOSWALL+PARKWAY%2C+EDINBURGH&ASSESSOR_ID=&SEARCH_TABLE=valuation_roll_cpsplit&DISPLAY_COUNT=10&TYPE_FLAG=CP&ORDER_BY=PROPERTY_ADDRESS&H_ORDER_BY=SET+DESC&DRILL_SEARCH_TERM=BOSWALL+PARKWAY%2C+EDINBURGH&DD_TOWN=EDINBURGH&DD_STREET=BOSWALL+PARKWAY&UARN=110B60329&PPRN=000000000001745&ASSESSOR_IDX=10&DISPLAY_MODE=FULL#results'

baseurl = 'https://www.saa.gov.uk'
session = requests.session()
response = session.get(url)

# content of search page in soup 
html = soup(response.content,"lxml")

Address = LeftBlockData[3].get_text().strip()
print (Address)
Run Code Online (Sandbox Code Playgroud)

然而它打印像这样 '29 BOSWALL PARKWAYEDINBURGHEH5 2BR'

那里是是<br />文本之间的一个替代'no space'.

我想在目前的地方放一个逗号<br />.

请问有人可以推荐一种方法吗?

html python beautifulsoup

1
推荐指数
1
解决办法
415
查看次数

py2neo连接错误(身份验证错误)

我一直试图连接到neo4j,进行身份验证并创建具有各种属性的节点。neoj在http:// localhost:7474 /中正常工作。我在下面用mypassword替换了我的实际密码(我很确定它不是密码问题,因为我已经通过cmd提示连接到neo4j了)

import py2neo
from py2neo import authenticate,Graph, Node

def creatNodeWithLabelProperties():
    print("Start - Creating Node with Label and Properties")

    # Authenticate the user using py2neo.authentication

    py2neo.authenticate("localhost:7474", "neo4j", "mypassword")

    # Connect to Graph and get the instance of Graph

    graph = Graph("http://localhost:7474/db/data/")


    node1 = Node("FirstLabel", name="MyPythonNode1", neo4j_version="2.2")

    node2 = Node("FirstLabel", "SecondLabel",name="MyPythonNode2", neo4j_version="2.2")

    resultNodes = graph.create(node1, node2)

    for index in range(len(resultNodes)):
        print("Created Node - ", index, ", ", resultNodes[index])
    print("End - Creating Node with Label and Properties")


def createNodeWithLabelPropertiesWithCast(): …
Run Code Online (Sandbox Code Playgroud)

python neo4j py2neo

1
推荐指数
1
解决办法
1689
查看次数

标签 统计

python ×2

beautifulsoup ×1

html ×1

neo4j ×1

py2neo ×1