Capillarity is prevalent in nature, daily life, and industrial processes, governed by the fundamental Young–Laplace equation. Solving this equation not only deepens our understanding of natural phenomena but also yields insight into industrial advancements. To tackle the challenges posed by traditional numerical methods in parameter identification and complex boundary condition handling, the Young–Laplace physics-informed neural network (Y–L PINN) is established to solve the Young–Laplace equation within tubular domain. The computations on the classical capillary rise scenario confirm the accuracy of the proposed method on the basis of the comparison with Jurin's law, experimental data, and numerical results. Furthermore, the Y–L PINN method excels in parameter identification, e.g., contact angle, Bond number, and so on. These numerical examples even demonstrate its excellent predictive ability from the noisy data. For the complex boundary, it is rather convenient to obtain the liquid meniscus shapes in vessels, which is in good agreement with the experimental results. We further examine the variation of meniscus profile with wetting condition or discontinuous boundary. Importantly, the Y–L PINN method could directly solve the Young–Laplace equation with discontinuous wetting boundary without additional techniques. This work provides valuable insight for material wettability assessments, microstructure preparation, and microfluidics research.