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 />.
请问有人可以推荐一种方法吗?
我一直试图连接到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)