我的代码在哪里出错,导致每个字符都换行?

时间:2019-04-17 18:46:59

标签: python-3.x beautifulsoup twilio

我写了一个简单的脚本,可以访问craigslist,查找Chevy S10零件,然后使用Twilio向我发送带有广告标题的SMS消息。由于某种原因,我的文字标题中的每个字符都换行了……这是我的代码:

public class HelpStep {
    //setup or tear-down not required here...

    @Given("^The user is on the Help page$")
    public void onPage() {
       //you can access driver any where like below:
       //WebDriver driver = new WebDriverTestBase().getDriver();
        System.out.println("The user is on the Help page");
    }

    @When("^The user clicks on the links within the Help page$")
    public void clickLinks() {
        System.out.println("The user clicks on the links within the Help page");
    }

    @Then("^The user is navigated to that section$")
    public void validate() {
        System.out.println("The user is navigated to that section");
    }
}

任何帮助将不胜感激。预先谢谢你

1 个答案:

答案 0 :(得分:0)

此处是Twilio开发人员的传播者。如果您取出第二个“ \ n”字符并使body行改为

body = 'New S10 Posts!\n' + data.text

然后,文本与标题中的每个字符都在同一行。