Python has been unsuccessful in replacing the content in front of the vertical bar symbol in the title.

python replaces the content in front of the vertical bar symbol in the title, but it has been unsuccessful, for example: Chen Ning column (Chinese football fight to correct the name of Wales Uruguay for the championship, replace Chen Ning column for other
this is my code:

title = re.sub(re.compile("(.*?)\|",re.S), ""  + "|",title)

do me a favor, just learn python crawler, want to be a website

Feb.26,2021

>>> import re
>>> title = " "
>>> re.compile('.*?').sub('', title)
' '

import re
title = "  "
title = re.sub(re.compile('(.*?)',re.S),'' + '',title) -sharp 
Menu